Solved

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

Posted on 2007-11-27
3
1,093 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 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