![]() |
Options with boolean value 0 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Options with boolean value 0 (/showthread.php?tid=56891) Pages:
1
2
|
Options with boolean value 0 - El Forum - 01-28-2013 [eluser]CroNiX[/eluser] I'm sorry, I'm not really sure what you mean by what you just said: "only if the model returning 1 else nothing in value not even the attribute value=”“" One thing I would do is remove the php for echoing the value. Put that in the regular html portion of the tag. The way you have it written you are not including a space before it echos 'value="1"' so if the item was checked the html would come out like: Code: //notice lack of space between checked and value attributes Try writing them like Code: <input type="checkbox" id="inlineCheckbox1" name="add" <?php echo ($right->add==1)?'checked="checked"':''; ?> value="1" /> Add also notice I closed your input with a Code: /> Options with boolean value 0 - El Forum - 01-28-2013 [eluser]cPage[/eluser] sorry i edit my post because i realized about the value="1" do not have to be echo, its always value="1" whatever its checked,and if it is not checked then it return FALSE. The slash / is not required in html 5. Finish function update Code: public function update() HTML Code: <div class="control-group"> Again thank you CroNiX |