Jump to content

Could someone explain this to me?


Lord Dolmus

Recommended Posts

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

<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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...