Solved

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

Posted on 2007-11-27
3
1,084 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:
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SignalR - getting new data from sql DB 5 64
asp.net bundle 8 36
Wpf develop 5 32
Make a border less form movable 2 11
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now