"which button was clicked" should read which button of which group was
picked (odd or even) button 1 and 3 = odd, etc.
"Roland Hall" <nobody@nowhere> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Zalek...
I took the form you had, except I put values on the buttons, and I rewrote
the script. I performed a calculation to check if a is odd or even, which
tells me which button was clicked, by using the vbscript command MOD with a
value of 2. If it returns a 1 (odd), then I set the action of the form to
modify.asp. If it returns a 0 (even) then I set the action to view.asp.
Remove the alerts. Remove the comment tags in the script to submit the form
and set the return to true.
Perhaps this will give you some ideas to get your script working the way you
want it to.
http://kiddanger.com/lab/form0.html
"Zalek Bloom" <Za********@hotmail.com> wrote in message
news:mu********************************@4ax.com...
Hello,
Here is my problem:
I am displaying to a user a row of buttons. Depending on which button
user presses, I want to go to a different URL and to give a different
value to a hidden variable.
My code is:
<FORM NAME=FORM1 ACTION="">
<input type="button" name="B1" onclick="ModC('1')">
<input type="button" name="B2" onclick="ModC('2')">
<input type="button" name="B3" onclick="ModC('3')">
<input type="hidden" name="property_key" value="0">
function ModC(a)
document.form1.property_key.value = a
document.form1.submit()
End Function
Now, I want also to change ACTION parm on the FORM, so depending on
some calculation ACTION=MODIFY.ASP or ACTION=SHOW.ASP
I tried:
<input type="button" name="B1"
onclick="document.form1.action ='MODIFY.ASP' ; ModC('1')">
this didn't work. Any ideas how to solve this problem?
Thanks,
Zalek