RequiredFieldValidator question..

J

James Radke

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
 
J

Jim Shelly

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.
 
Y

Yan-Hong Huang[MSFT]

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" <[email protected]>
!From: "James Radke" <[email protected]>
!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: <[email protected]>
!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
!
!
!
 
Y

Yan-Hong Huang[MSFT]

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" <[email protected]>
!From: "James Radke" <[email protected]>
!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: <[email protected]>
!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
!
!
!
 
E

Erica Lewis

I too I'm having this same problem and have no I Idea how
to resolve it. The validaion works on one server and
doesn't work on another. They are both running WINNT.
One server has VJSharp and the other doesn't but
otherwise they are both running the same framework
(v1.1.4322)...
 
E

Erica Lewis

I was able to resolve the problem by running
ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
 
Y

Yan-Hong Huang[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top