A
actionwoman63
Dear all
I need to be able to check which one out of two submit buttons within
the same form was pressed in a javascript function prior to form
submission. And before I get flamed for not finding the answer in
previous posts - I have already seen this question answered numerous
times in this forum, only problem is that the recommended method is
not available to me :-(. I know that if I could code an onclick event
on the <input type=submit> tag, then call a function which sets a
value corresponding to the button clicked, this would be a cinch, but
I can't as I am working with a templated system which automatically
generates the <input> tags.
Question to you guys, is there any other way of getting this info in
my javascript function?
Code (shortened)
----------------
<SCRIPT LANGUAGE="JavaScript1.1">
function verify(f)
{
Need to put code in here to check which of the two submit buttons was
pressed, as makes no sense to user to validate input when they press
the 'cancel order' button.
}
</SCRIPT>
<FORM onSubmit="return verify(this);" ACTION="somescript.exe"
METHOD=POST>
<INPUT TYPE=text NAME=delName VALUE="">
<TEXTAREA ROWS=4 COLS=32 NAME=delAddr></TEXTAREA>
<INPUT TYPE=text NAME=delTown VALUE="">
<INPUT NAME="op-basket-cancel_order" TYPE=submit VALUE="Cancel Order">
<INPUT NAME="op-basket-confirm_order" TYPE=submit VALUE="Go To
Checkout">
</FORM>
Grateful for any advice, or if anyone can spot a different workround
to solve my problem.
Actionwoman63
I need to be able to check which one out of two submit buttons within
the same form was pressed in a javascript function prior to form
submission. And before I get flamed for not finding the answer in
previous posts - I have already seen this question answered numerous
times in this forum, only problem is that the recommended method is
not available to me :-(. I know that if I could code an onclick event
on the <input type=submit> tag, then call a function which sets a
value corresponding to the button clicked, this would be a cinch, but
I can't as I am working with a templated system which automatically
generates the <input> tags.
Question to you guys, is there any other way of getting this info in
my javascript function?
Code (shortened)
----------------
<SCRIPT LANGUAGE="JavaScript1.1">
function verify(f)
{
Need to put code in here to check which of the two submit buttons was
pressed, as makes no sense to user to validate input when they press
the 'cancel order' button.
}
</SCRIPT>
<FORM onSubmit="return verify(this);" ACTION="somescript.exe"
METHOD=POST>
<INPUT TYPE=text NAME=delName VALUE="">
<TEXTAREA ROWS=4 COLS=32 NAME=delAddr></TEXTAREA>
<INPUT TYPE=text NAME=delTown VALUE="">
<INPUT NAME="op-basket-cancel_order" TYPE=submit VALUE="Cancel Order">
<INPUT NAME="op-basket-confirm_order" TYPE=submit VALUE="Go To
Checkout">
</FORM>
Grateful for any advice, or if anyone can spot a different workround
to solve my problem.
Actionwoman63