For some strange reason, an alert dialog with the text title "Message From Web page" and message "-" displays when posting back a form with validation. There are no custom validation scripts that display an alert window. I am debugging JavaScript using IE development toolbar? Is it possible to break into the code that displays the alert box? So far I have been unable to do so.
CTRL-SHIFT-J (also under the Page > Developer > Debug JavaScript menu item) in chrome to debug javascript. Debuggin in chrome is easier than IE
the validation error was displayed by validation summary control with no display.
Thanks for taking the time.
Related
I have some input fields, regular expression validators, and custom validators inside an ASP.NET ASCX control. The behavior is a bit odd in that it works the following way:
If a client side validator flags an error message and I tab away from the input field and click submit then the page posts as it should. However, if a client side validator has flagged an error and instead I correct the error and click submit button then the error is cleared but the page is not submitted until I click the submit button a second time.
My question is how do I change this behavior such that I only need to click the submit button once to both clear the error and postback the page? Also, is this "behavior" standard?
Update: This behavior occurs without using the user control. I believe it is specific behavior to the CompareValidator. Nope, same behavior occurs with custom validator. If I don't "tab away" and click the button then I must click it twice to get the postback to occur. The first click just clears the validators.
The issue is that the CustomValidator has display type as Dynamic and not Static. This post helped me to discover the answer
RequiredFieldValidator have to click twice
I will give credit for anyone who explains why it causes this behavior.
I have written a web page that provides a drop down list of reports that can be viewed. The fiddle is here: http://jsfiddle.net/ZrdUY/1/. The image in the fiddle is exactly what you see when you open the page in Firefox (13.0.1) but when the page is opened in IE6 it seems that the "View Report" event is triggered with the visible selection in the drop down list thus immediately rendering that report.
Any advice is appreciated.
Regards.
Weird. The problem simply went away.
I have asp.net ajax modal popup extender in which I have placed text boxes. The text boxes are validated and the validation error messages are shown.
There is a scenario where I need to clear the validation error messages.
When I save the modal popup without entering values, validation error messages appear. Now I close the modal popup clicking on cancel button.
Next time when I open the modal popup I see the same error messages. How could I clear just the validation error messages through jquery. I don't want to disable the validators but I only need to clear the error.
Via user10725000, who really deserves the credit:
I tried the bellow code and then it worked. Cheers!
$.each(Page_Validators, function (index, validator) {
$(validator).attr('style','display:none;')
});
I'm using the ASP.NET Membership provider and using the Password Recovery control to reset the user password if they forget it. On the whole it all works fine, but with one catch when it comes to validation.
I have expanded the PasswordRecovery control out to use the template feature to customise the appearance, which is all fine. I have set the user lookup error handler using:
OnUserLookupError="PasswordRecovery1_UserLookupError"
in the opening tag and if I load up the page, type in some junk name and click submit this fires as expected, in all browsers. The snippet of VB code makes an error div visible and sets some text.
However, if upon loading the page for the first time I type a duff name into the username box and hit the enter key to submit the form, in Internet Explorer (version 8), the UserLookupError event fails to trigger. It triggers just fine in Chrome or Firefox, just not in IE. I know it's not a focus issue on the form, as I can see the form is being submitted.
If I click the submit button first, then following that hit the enter key it does fire, it's just that first time it doesn't, and only in IE.
Also to add that if I set breakpoints in the VB code to check to see if the page is being submitted, I can see the Page_Load event fire when I hit the enter key, but not the sub PasswordRecovery1_UserLookupError.
Has anyone else seen this? It looks like a bug in IE (no really???), but I need to nail it down.
Any help would be welcome.
OK, after some more digging and testing this is actually only a default button issue. I'm not sure what's happening when the enter key is being pressed (only in IE) after text has been entered in the box, as it is reloading the page but not submitting it. There is no other control or function on the page which would navigate back to or refresh this page.
Despite the submit button appearing to be the default button it actually isn't. The key here therefore is setting the defaultbutton property of the webform. That however, when the button is inside a PasswordRecovery control is another issue.
EDIT:
Here's the fix. Set the default button at the page load stage.
Me.Form.DefaultButton = PasswordRecovery1.UserNameTemplateContainer.FindControl("SubmitButton").UniqueID
I have encountered a weird problem that does not exist in Firefox or IE. I have a user control that has a text box and a required field validator. When the user control is hosted in an update panel, the UpdateProgress tag never closes the first time that the UpdateProgress is triggered on the page when the page is viewed in Chrome. Has anyone else encountered this, and if so, is there any solution other than removing the validator? I could manually validate, but who wants to do that to support a browser bug?
The workaround simply tells ASP.NET AJAX that Safari 3 and Google Chrome are a new type of browser instead of the old Safari for which workarounds had to be programmed.
http://blog.lavablast.com/post/2008/10/20/Gotcha-WebKit-(Safari-3-and-Google-Chrome)-Bug-with-ASPNET-AJAX.aspx