jkkenzie Posted October 14, 2008 Share Posted October 14, 2008 Hi! If a value in my database field say "Receipt Issued" = 1 or 0, what would be included in this code so that my check box shows a TICK or No TICK: <input type="checkbox" name="Receipt_Issued" value=" <?php xx ?>" /> Link to comment https://forums.phpfreaks.com/topic/128330-solved-checkbox/ Share on other sites More sharing options...
Daniel0 Posted October 14, 2008 Share Posted October 14, 2008 <input type="checkbox" name="Receipt_Issued" value="1" <?php if ($issued) { echo 'checked="checked"'; } ?>/> Something like this. Link to comment https://forums.phpfreaks.com/topic/128330-solved-checkbox/#findComment-664775 Share on other sites More sharing options...
New Coder Posted October 14, 2008 Share Posted October 14, 2008 <input type="checkbox" name="Receipt_Issued" value="1" <?php if ($issued) { echo 'checked="checked"'; } ?>/> Something like this. I've tried the above but it didnt work for me so if you find it doesn't work also try <input type="checkbox" name="Receipt_Issued" <?php if ($issued=='1') { echo "checked"; }?> /> Link to comment https://forums.phpfreaks.com/topic/128330-solved-checkbox/#findComment-664885 Share on other sites More sharing options...
jkkenzie Posted October 15, 2008 Author Share Posted October 15, 2008 Thanks it worked Link to comment https://forums.phpfreaks.com/topic/128330-solved-checkbox/#findComment-665883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.