|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
i7 Smarty n00b
Joined: 08 Aug 2019 Posts: 1
|
Posted: Thu Aug 08, 2019 2:04 pm Post subject: Please help {html_options...} not quite working as it used |
|
|
Hi,
I've had a bit of the code to record hours e.g. 1.0 1.5 2.0 2.5...:
{html_options values=$hours output=$hours selected=$information[0].r3}
In the old version used to work perfectly and the drop down value was slected correctly based on the value e.g. 2.0 was the same as 2, however in the new version:
If selected value is 2 (not 2.0) the correct value doesn't get selected correctly and I have to add: |string_format:"%.2f"
{html_options values=$hours output=$hours selected=$information[0].r3|string_format:"%.2f"}
now it seems to be doing literal comparison so 1.50 is NOT the same as 1.5.
Is this how it works now? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun Aug 11, 2019 11:41 am Post subject: |
|
|
That's to be expected. HTML options values are strings, you have to match the value exactly.
In other words, your old code was wrong and shouldn't have been working. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|