point86 Posted February 12, 2007 Share Posted February 12, 2007 Hello, Basically I have a HTML checkbox: <input type="checkbox" name="check1" value="" id="check1"> How do I make it so that when the user checks the checkbox, a predefined variable (eg "var ischecked" is changed? Thanks P86. Link to comment https://forums.phpfreaks.com/topic/38205-checkbox-variables/ Share on other sites More sharing options...
artacus Posted February 13, 2007 Share Posted February 13, 2007 input type="checkbox" name="check1" value="" id="check1" onchange="checkcheck(this);"> var ischecked = false; function checkcheck(cbObj) { ischecked = cbObj.checked; } Link to comment https://forums.phpfreaks.com/topic/38205-checkbox-variables/#findComment-183449 Share on other sites More sharing options...
point86 Posted February 14, 2007 Author Share Posted February 14, 2007 This is great. Now how would I apply this so I could use it in a seperate PHP script within the same directory? Thanks P86 Link to comment https://forums.phpfreaks.com/topic/38205-checkbox-variables/#findComment-184665 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.