Forum Moderators: open

Message Too Old, No Replies

two submit buttons

for a select box

         

randomuser

12:41 am on Jul 21, 2002 (gmt 0)

10+ Year Member



i basically want to have one drop-down select thing with two submit buttons that do different things. how do you do that?

bobriggs

1:34 am on Jul 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Read the 'value' of the submit button. That will tell you what to do. Make sure you give each button a name.

<input type="submit" name="button1" value="dothis">
<input type="submit" name="button2" value="dothat">

I'm not sure but you might be able to get by with the same name= . I haven't tried it though.

Reading through the W3c specs, I think you can do it:

<input type="submit" name="dowhat" value="dothis">
<input type="submit" name="dowhat" value="dothat">

Your query will be generated:
?selectname=selectvalue&dowhat=dothis (or dothat)

randomuser

3:04 am on Jul 21, 2002 (gmt 0)

10+ Year Member



ah, thank you.