budimir Posted August 11, 2008 Share Posted August 11, 2008 Hey guys, Can someone point me to the right direction. I want to click on checkbox and save that info in DB without creating a form and clicking on a submit button. Any ideas how to do that?? Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/ Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 Javascript... and its MUCH easier to have a form. Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/#findComment-613964 Share on other sites More sharing options...
budimir Posted August 11, 2008 Author Share Posted August 11, 2008 OK, You have a link to any tutorials, or a peace of code where I could take a look at that??? Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/#findComment-613972 Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 This is the easiest way, assuming the input is surrounded by a <form> <input type="checkbox" onClick="submit();" /> I suggest moving any further help you need to a javascript forum. Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/#findComment-613981 Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Share Posted August 11, 2008 To elaborate a bit more if you dont want the page to (re)load then you'll need AJAX however if you just want the checkbox to cause the form to submit then what you need is this: onCLick="doument.FORMNAME.submit();" just add it to the tag for the check box, for the AJAX a quick google for AJAX example should get you in the right direction, then if you need help with that there are javascript forums here on phpfreaks. Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/#findComment-613983 Share on other sites More sharing options...
budimir Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks a lot guys. I got an idea how to do it. Link to comment https://forums.phpfreaks.com/topic/119205-solved-checkbox-store-value/#findComment-613985 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.