PDA

View Full Version : Form with two submit buttons?


Nomadicus
11-13-2002, 01:14 PM
I'm trying to place two submit buttons on a form and then have the form choose which page to display next, e.g. :

<form method="post" action= "nextform.htm">

The buttons would be as :

<input type="submit" name="gohere" value="GoHere">

<input type="submit" name="gothere" value="GoThere">

I think Javascript can handle this with its onClick event, but I don't know exactly how to do this.

Thanks in advance.

beetle
11-13-2002, 02:43 PM
<input type="submit" name="gohere" value="GoHere" onClick="this.form.action='page1.htm';">

<input type="submit" name="gothere" value="GoThere" onClick="this.form.action='page2.htm';">