vinpkl Posted June 20, 2009 Share Posted June 20, 2009 hi all i want to auto submit the form and run the update query on just selecting the checkbox. I m able to run the update query on selecting checkbox and clicking update button. But how can i auto submit form and run update query on just selecting of checkbox and without clicking the update button. i m using the below code but nothing happens <form action="http://localhost/gads/catalogue.php" method="post" name="product" id="product"> <input type="checkbox" name="rural" id="rural" onchange="product.submit();" </form> if(isset($_REQUEST['rural'])) { update query } vineet Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 20, 2009 Share Posted June 20, 2009 Try: <form action="http://localhost/gads/catalogue.php" method="post" name="product" id="product"> <input type="checkbox" name="rural" id="rural" onclick="document.forms.product.submit();" /> </form> Quote Link to comment Share on other sites More sharing options...
vinpkl Posted June 20, 2009 Author Share Posted June 20, 2009 Try: <form action="http://localhost/gads/catalogue.php" method="post" name="product" id="product"> <input type="checkbox" name="rural" id="rural" onclick="document.forms.product.submit();" /> </form> hi Ken2k7 thanks for the reply. it works great as needed. but the checkbox doesnt remain selected. can checkbox remain selected until user uncheck it. or will it be done server side. vineet 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.