RequiredFieldValidator question..

Discussion in 'ASP .Net Web Controls' started by James Radke, Oct 14, 2003.

  1. James Radke

    James Radke Guest

    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
     
    James Radke, Oct 14, 2003
    #1
    1. Advertising

  2. James Radke

    Jim Shelly Guest

    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.

    "James Radke" <> wrote in message
    news:...
    > 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, Oct 15, 2003
    #2
    1. Advertising

  3. 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" <>
    !From: "James Radke" <>
    !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: <>
    !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
    !
    !
    !
     
    Yan-Hong Huang[MSFT], Oct 15, 2003
    #3
  4. 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" <>
    !From: "James Radke" <>
    !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: <>
    !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
    !
    !
    !
     
    Yan-Hong Huang[MSFT], Oct 17, 2003
    #4
  5. James Radke

    Erica Lewis Guest

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

    >-----Original Message-----
    >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" <>
    >!From: "James Radke" <>
    >!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: <>
    >!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:1536

    0
    >!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, Oct 28, 2003
    #5
  6. James Radke

    Erica Lewis Guest

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

    >-----Original Message-----
    >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" <>
    >!From: "James Radke" <>
    >!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: <>
    >!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:1536

    0
    >!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, Oct 28, 2003
    #6
  7. 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.
     
    Yan-Hong Huang[MSFT], Oct 29, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pc
    Replies:
    2
    Views:
    394
    Peter Chang
    Jul 28, 2003
  2. Vic
    Replies:
    2
    Views:
    349
  3. Curt_C [MVP]

    Re: RequiredFieldValidator question

    Curt_C [MVP], Apr 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    388
    Curt_C [MVP]
    Apr 14, 2004
  4. Steven Cheng[MSFT]

    RE: RequiredFieldValidator question

    Steven Cheng[MSFT], Apr 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,833
    Peter Blum
    Apr 15, 2004
  5. Randel Bjorkquist

    RequiredFieldValidator Question

    Randel Bjorkquist, Mar 29, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    163
    Randel Bjorkquist
    Mar 29, 2005
Loading...

Share This Page