[thelist] javascript confirm dual submit nastiness

Tom Dell'Aringa pixelmech at yahoo.com
Fri Nov 22 11:56:01 CST 2002


I've got a form with TWO submit buttons - one is edit one is delete.
Depending on which button is pressed, my php page either gives the
user an edit form with the variable passed by the form filled in - or
it simply deletes the item.

Now, of course I want them to confirm the deletion. Here's the
trouble. I can't use the onClick event handler since its a submit
button. (Although I tried various ways to make this work, such as
setting theform.submit = false while passing this.form, which
failed).

If I use the onSubmit handler (which I would normally do), then I
will get the confirm for edit, which I don't want.

Any ideas? Somehow I need to know which button has been pressed in my
function or somwehat..

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the thelist mailing list