[thelist] JS: test which submit button was clicked.

Scott Brady evolt at scottbrady.net
Fri Jun 4 11:56:18 CDT 2004


Original Message:
> From: Tom Dell'Aringa 

> The problem is you can't have two submit buttons with the same name.

Sure you can.  They can't have the same ID, however.  Ideally, they'd have two separate names, but there's nothing wrong with it.  You just have to keep in mind that they're now part of an array when referencing them in JS.

> In any event, you are going about it the wrong way - two submit
> buttons in not the way to go.

> Have a radio button set that has your "approve / reject" choice. Test
> the radio group instead.

If I'm a user, I think I'd rather have two submit buttons to click (so I'm only clicking once) instead of having to click a radio button and then submit (clicking twice).  But, that's me.  (Just make sure that the "default" submit button is the one that does the least damage if they hit "Enter" in the form some where)

----------------------------
Scott Brady
http://www.scottbrady.net/




More information about the thelist mailing list