I have an ASP.NET Web Forms application that uses the Wizard Template control.
In my wizard there are four pages (forms) and I would like to use jQuery in order to disable the submit button on the last page (the buttons on the other pages are just next and previous) I want to do this in order to prevent the user to click more times on the button, causing the forms to be submitted more than once.
The "issue"is that it is not possible to assign IDs to the submit button(s) since they are auto-generated (and I have explicitly asked not to modify this behavior).
I tried this jQuery but it does not work:
$('#form1').submit(function () {
$(this).children('input[type=submit]').attr('disabled', 'disabled');
});
Where form1 is the id of the form wrapping the wizard. Anybody might help?
You are missing the # before
form1in your selector.You havent defined
ereturn false will do a preventDefault, no need for both
Edit:
Set the CssClass-attribute on the button to
submitbuttonOr in your example i would suppose something like this would work