Groups | Blog | Home
all groups > asp.net webcontrols > october 2003 >

asp.net webcontrols : RequiredFieldValidator question..


James Radke
10/14/2003 5:13:17 PM
Hello,

I am placing a required field validator control to ensure that some data is
entered into a textbox, but when I bring up the web page, the required field
validator only generates a client side error AFTER the user has modified the
field once, and erased all data, and not if a user tabs to and past a field
that is initialized to blank?

Can someone tell me why this is happening?

Thanks!

Jim

Jim Shelly
10/14/2003 11:01:37 PM
The RequiredFieldValidator is a Server Control that uses a .js file for
client side messaging. When you set a requiredfieldvalidator on a textbox,
the validation doesn't take place until the page is posted back to the
server.

I haven't looked into it, but check out the Custom Validator Control. This
requires you to write the validation yourself, but it may allow you to add
the client side validation you wish on the "onBlur" event.

[quoted text, click to view]

yhhuang NO[at]SPAM online.microsoft.com
10/15/2003 7:47:49 AM
Hello Jim,

Thanks for posting in the group.

We could enable client-side validation for your page. (By default it is
enabled) Client-side validation enhances the validation process by checking
user input before it is sent to the server. This allows errors to be
detected on the client before the form is submitted, avoiding the
round-trip of information necessary for server-side validation

Client-side validation works using client JScript. And the validation Web
controls script that is in a script library. Code in the script library
will be executed as users tab from field to field. The validation
conditions are re-evaluated when a dependent field is changed, and the
validator is made visible or invisible as appropriate.

For details, I suggest you read MSDN article:
"ASP.NET Validation in Depth"
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspplusvalid.asp?frame=t
rue

This article discusses in detail how the ASP.NET validation controls work
and is recommended reading for anyone building complex pages with
validation controls or those looking to extend the validation framework.

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Reply-To: "James Radke" <jradke1@wi.rr.com>
!From: "James Radke" <jradke1@wi.rr.com>
!Subject: RequiredFieldValidator question..
!Date: Tue, 14 Oct 2003 17:13:17 -0500
!Lines: 15
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <OrR9fBqkDHA.2488@TK2MSFTNGP12.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
!NNTP-Posting-Host: cpe-24-167-241-101.wi.rr.com 24.167.241.101
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
!Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:15360
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
!
!Hello,
!
!I am placing a required field validator control to ensure that some data is
!entered into a textbox, but when I bring up the web page, the required
field
!validator only generates a client side error AFTER the user has modified
the
!field once, and erased all data, and not if a user tabs to and past a field
!that is initialized to blank?
!
!Can someone tell me why this is happening?
!
!Thanks!
!
!Jim
!
!
!
yhhuang NO[at]SPAM online.microsoft.com
10/17/2003 1:59:40 AM
Hello Jim,

Do you have any more concerns on the question? Please post here if there
are any questions on it. :)

Thanks for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Reply-To: "James Radke" <jradke1@wi.rr.com>
!From: "James Radke" <jradke1@wi.rr.com>
!Subject: RequiredFieldValidator question..
!Date: Tue, 14 Oct 2003 17:13:17 -0500
!Lines: 15
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <OrR9fBqkDHA.2488@TK2MSFTNGP12.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
!NNTP-Posting-Host: cpe-24-167-241-101.wi.rr.com 24.167.241.101
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
!Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:15360
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
!
!Hello,
!
!I am placing a required field validator control to ensure that some data is
!entered into a textbox, but when I bring up the web page, the required
field
!validator only generates a client side error AFTER the user has modified
the
!field once, and erased all data, and not if a user tabs to and past a field
!that is initialized to blank?
!
!Can someone tell me why this is happening?
!
!Thanks!
!
!Jim
!
!
!
Erica Lewis
10/28/2003 7:54:16 AM
I too I'm having this same problem and have no I Idea how=20
to resolve it. The validaion works on one server and=20
doesn't work on another. They are both running WINNT. =20
One server has VJSharp and the other doesn't but=20
otherwise they are both running the same framework=20
(v1.1.4322)...=20

[quoted text, click to view]
Erica Lewis
10/28/2003 8:08:57 AM
I was able to resolve the problem by running
ASP.NET IIS Registration Tool (Aspnet_regiis.exe)

[quoted text, click to view]
yhhuang NO[at]SPAM online.microsoft.com
10/29/2003 1:24:55 AM
Hi Erica,

I am glad to hear the problem is resolved. If the problem happens on one
machine and doesn't happen on another machien, the most possible reason is
in installation.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button