Short if statement is not working properly
Posted on 2009-02-11
I have two if statements in my input fields for two radio buttons. The deal is to have the on radio button checked if the viewable field reads on and the off radio button is checked if the viewable field reads off. I hope that makes since. Anyway, this is my code.
<input " . ($item['viewable'] == 'on') ? ('checked=checked') : ('') . " type='radio' name='viewable' value='on'> On <br/><input " . ($item['viewable'] == 'off') ? ('checked=checked') : ('') . " type='radio' name='viewable' value='off'> Off
Right now all I get is the following output: