Lord Dolmus Posted April 23, 2007 Share Posted April 23, 2007 Ok, it's an html code that creates checkboxes with a submit button. If I were to make one, how would I make the submit button go to another page? As you can see the code doesn't show where you put in the url where the submit button takes you. <html><body><form name="input" action="html_form_action.asp" method="get">I have a bike:<input type="checkbox" name="vehicle" value="Bike" checked="checked" /><br />I have a car: <input type="checkbox" name="vehicle" value="Car" /><br />I have an airplane: <input type="checkbox" name="vehicle" value="Airplane" /><br /><br /><input type="submit" value="Submit" /></form> <p>If you click the "Submit" button, you send your input to a new page called html_form_action.asp.</p></body></html> Link to comment Share on other sites More sharing options...
Skemcin Posted April 23, 2007 Share Posted April 23, 2007 <form name="input" action="html_form_action.asp" method="get">The "action" attribute dictates where the form gets posted. Now, if you want the page to redirect somewhere else based on what check box was selected, then you have two options:a.) use asp code on your action page to look at the check box selected and then redirect accordingly.orb.) use javascript on submit to sniff which check box was selected and then have the javascript do a document.location to the url defined/associated with the check box selected.Both solutions can be found by googling them. Link to comment Share on other sites More sharing options...
Lord Dolmus Posted April 23, 2007 Author Share Posted April 23, 2007 Ooops! I didn't see that there, sorry. Next time I'll look closer, thank you! Link to comment Share on other sites More sharing options...
Skemcin Posted April 24, 2007 Share Posted April 24, 2007 no worries, post any other issues that you come across Link to comment Share on other sites More sharing options...
boen_robot Posted April 24, 2007 Share Posted April 24, 2007 Just for the record: using the server to make redirects is better, as JavaScript could be unavailable or simply disabled on the client. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.