Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to re-enable submit button at end of a Wizard control.

Posted on 2007-11-27
3
Medium Priority
?
1,096 Views
Last Modified: 2013-12-16
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.FindControl("FinishNavigationTemplateContainerID$FinishButton");
  string script = String.Format("{0}.disabled = true;{0}.value='Please wait...';", myFinishButton.ClientID);
  myFinishButton.OnClientClick = 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.
0
Comment
Question by:Homer2040
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Joel Coehoorn earned 1500 total points
ID: 20361367
I could be wrong, but I don't think there is a multiple-click issue with ASP.Net or the wizard control; it's sort of taken care of for you, making this whole problem moot.  When you click the first time, the form submits and can't submit again until the page has finished loading.  By this time if validation has failed multiple clicks are safe, because nothing will happen when the form is re-submitted.

Like I said at first, though, I'm not 100% sure on that and you'll want to do some googling to verify this statement before relying on it.
0
 

Author Comment

by:Homer2040
ID: 20366146
jcoehoorn,

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.
0
 

Author Closing Comment

by:Homer2040
ID: 31411287
Sorry for the delay in closing this question.
Used a variation of this suggestion so I'll award the points.

H.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question