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?? Quote Link to comment 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. Quote Link to comment 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??? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.