[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
<input type="checkbox" id="inlineCheckbox1" name="add" checked="checked"value="1" > Add
But that part has no logic (it will always be value="1") so just put it as pure html within the tag
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
instead of just a >