"Willie" <wi****@pdfsystems.comwrote in message
news:f7*********@news5.newsguy.com...
Hi All;
I have a form with multiple buttons and I would like to disable the
buttons after the user clicks on the button to prevent multiple
submitions.
Why? You need to handle that on the server as you can't count on
JavaScript.
>
<input type="submit" name="return1" value="Send To MFG" id="return1"
onClick='this.disabled=true;this.form.submit()' >
This works but I do not get the return1 value passed to the action script
as I do if I just have :
<input type="submit" name="return1" value="Send To MFG" id="return1" >
In the first example you disabled it and then submitted the form with
script. So of course the server has no idea which button was used for
submission (none were.)
>
I need this vale to be know which button was pushed. Is there a way of
passing a value with the form.submit() ?
Your second example is correct (but you shouldn't need the id attribute.)
If you must, you can add client-side code to hide all of the buttons when
one is clicked, but I wouldn't bother. You will still have the case of the
Enter key (assuming your form has text inputs), so just make sure your
server-side handler throws out duplicate posts.
>
Thanks
Willie