Jump to content

checkbox + Post forum


klapy

Recommended Posts

What I want to do is make a form with some checkboxesAs soon as 1 of the checkboxes is clicked I want to post the form so I can get the value of the checkbox through php and put that in a database.edit:... Hmm I got the title wrong :) anyone who can change this :)

Link to comment
Share on other sites

This would be the easiest way i think, put a onclick event directly on the checkboxes to submit the form.<form name="myform" id="myform" action="process.php" method="post">Male: <input type="checkbox" name="male" id="male" onclick="myform.submit()">Female: <input type="checkbox" name="female" id="female" onclick="myform.submit()"></form> As long as you don't have to many checkboxes that should be fine, if you have tons then you could probably use DOM to find out how many checkboxes are in the form then if one is clicked submit it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...