Re: Submit fails when using Validation Controls

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Peter Blum (PLBlum_at_Blum.info)
Date: 03/08/04


Date: Mon, 8 Mar 2004 16:00:56 -0500

After ValidatorCommonOnSubmit(), the next step for the javascript is to run
the <form onsubmit=> event. That code tests if Page_BlockSubmit to determine
if it should stop. There is a bug in earlier v1.1 net in this place, where
it doesn't use "return" to return true or false. This breaks IE/Mac for sure
and may be affecting you. There is a hotfix for v1.1 ASP.NET located at
msdn.microsoft.com. I don't know the KB article number.

Also just look at the code for onsubmit. If it involves other code than
validation, a javascript error in that other code may stop the script from
executing, and keep the page from submitting.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Andrew Winn" <anonymous@discussions.microsoft.com> wrote in message
news:8f4301c40534$270ce010$a001280a@phx.gbl...
> Sorry Typo (does should have been doesn't) in para
> below...
>
> On both the Test and Development servers it puts a true
> in the event.returnValue, but the Test server does'nt
> submit
> and therefore it doesn't go into the server side code for
> the login button's onClick event.
>
>
> Hope you can help?
>
> Andrew
>
>
> >-----Original Message-----
> >Hi,
> >
> >Got a problem with the required validation control not
> >posting back after a valid page is requested to be
> >submitted?
> >
> >I have a login page with the usual Username and Password
> >fields and a login button. Validation control checks
> that
> >there is something in the fields before allowing a post
> >back.
> >Problem only occurs on my Test Server (it works fine on
> >my development server - both are Windows 2000 Advanced
> >Server - Test is SP4 Dev is SP3). When I click Login
> with
> >the fields missing it detects this and displays an
> error;
> >however when I complete the fields and click login
> >nothing happens (or appears too).
> >I have traced the code through to the JavaScript file
> >WebUIValidation.js. ASP.NET puts an onSubmit event
> >handler on the form tag which calls
> >ValidatorCommonOnSubmit which is in the
> >WebUIValidation.js file.
> >
> >function ValidatorCommonOnSubmit() {
> > event.returnValue = !Page_BlockSubmit;
> > Page_BlockSubmit = false;
> >}
> >
> >
> >On both the Test and Development servers it puts a true
> >in the event.returnValue, but the Test server does
> submit
> >and therefore it doesn't go into the server side code
> for
> >the login button's onClick event.
> >
> >I have had a similar problem in the past and removed
> >Smart Navigation which did the trick, however this time
> >it makes no difference if Smart Navigation is true or
> >false.
> >
> >Any advice would be much appreciated
> >
> >Regards,
> >Andrew
> >
> >
> >.
> >


Quantcast