Homer2040
asked on
Need to re-enable submit button at end of a Wizard control.
Experts,
I have a wizard control with a FINISH button at the end that I disable onClick to prevent multiple clicks.
However, if the page fails validation, the button remains disabled and further attempts to submit a
corrected page is not possible.
The button is wrapped in a FinishedNavigationTemplate container:
<FinishNavigationTemplate>
<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" />
</FinishNavigationTemplate >
The onclick javascript is added in the page load:
Button myFinishButton = (Button)Wizard1.FindContro l("FinishN avigationT emplateCon tainerID$F inishButto n");
string script = String.Format("{0}.disable d = true;{0}.value='Please wait...';", myFinishButton.ClientID);
myFinishButton.OnClientCli ck = script;
I think I need to re-enable the button on every page load (postback or not), but also need it to re-enable if
a field that failed validation is corrected.
Any ideas?
Thanks.
H.
I have a wizard control with a FINISH button at the end that I disable onClick to prevent multiple clicks.
However, if the page fails validation, the button remains disabled and further attempts to submit a
corrected page is not possible.
The button is wrapped in a FinishedNavigationTemplate
<FinishNavigationTemplate>
<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete"
</FinishNavigationTemplate
The onclick javascript is added in the page load:
Button myFinishButton = (Button)Wizard1.FindContro
string script = String.Format("{0}.disable
myFinishButton.OnClientCli
I think I need to re-enable the button on every page load (postback or not), but also need it to re-enable if
a field that failed validation is corrected.
Any ideas?
Thanks.
H.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delay in closing this question.
Used a variation of this suggestion so I'll award the points.
H.
Used a variation of this suggestion so I'll award the points.
H.
ASKER
I removed the code I was using to disable the button & change the text onclick and tested it...
ASP.NET & the wizard control still allowed multiple clicks and I received multiple entries in the db.
Thanks though.
So I guess I'm back to the original problem...
1. Need to disable button to prevent multiple clicks (have code that handles this), also display different text on the button (also have code to handle this).
Item #1 may be moot.
2. Need the button to re-enable (and change text back) after page validation fails so it can be resubmitted.
H.