Welcome Guest, Not a member yet? Register   Sign In
set_radio and set_checkbox have problems with value of 0
#13

[eluser]nomikos3[/eluser]
Yes, still buggy in 1.7.2.

But you must never patch the core system.

The only solution is set values as chars (not integers):

wrong:
Code:
set_radio('radio_1', 0)

cool:
Code:
set_radio('radio_1', '0')

So in the the first sample at the top, should be:

Code:
Radio Choice:
<input type="radio" name="radio_1" value="0" <?=set_radio('radio_1', '0') ?>/>Choice 1
&lt;input type="radio" name="radio_1" value="1" &lt;?=set_radio('radio_1', '1') ?&gt;/&gt;Choice 2<br /><br />

Checkbox:
&lt;input type="checkbox" name="check_1" value="0" &lt;?=set_checkbox('check_1', '0') ?&gt; /&gt;&lt;br /><br />
---

I know that is very painful typing quotes, but these kind of issues always occur in PHP, so you may take this tip as a rule.

o/\o


Messages In This Thread
set_radio and set_checkbox have problems with value of 0 - by El Forum - 07-13-2010, 10:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB