Form Validation

Discussion in 'ASP .Net' started by TCORDON, Oct 23, 2005.

  1. TCORDON

    TCORDON Guest

    Is there a way to make the form validation highlight the fields where the
    errors occur? (change the backcolor of the textboxes)?

    And second, perform validation without postback and run some Javascript?

    TIA
    TCORDON, Oct 23, 2005
    #1
    1. Advertising

  2. Hi,

    Use a custom validator control. You can write your own routine in javascript for validation and in the process, highlight the fields that you want highlighted.

    Keep in mind though, that if you're going to be highlighting server side controls, you'll need their ClientIds, and that you can get from server side code. So, you'll need to write your custom javascript in the server side and plugging in the clientid values as you generate it.

    HTH,
    Altaf [MVP]




    --------------------------------------------------------------------------------
    All that glitters has a high refractive index.
    www.mendhak.com
    "TCORDON" <> wrote in message news:%23whyRv%...
    Is there a way to make the form validation highlight the fields where the
    errors occur? (change the backcolor of the textboxes)?

    And second, perform validation without postback and run some Javascript?

    TIA
    S.M. Altaf [MVP], Oct 23, 2005
    #2
    1. Advertising

  3. TCORDON

    Peter Blum Guest

    Instead of rewriting every validator with a custom validator, consider an
    alternative. I wrote a replacement to the ASP.NET validators called
    Professional Validation And More (http://www.peterblum.com/vam/home.aspx).
    You can set the style sheet of fields that have errors. You can have it set
    focus to the fields with the errors. There are several other techniques to
    attract the user's attention on its 25 validation controls. My validators
    provide client-side validation on many more browsers than the ASP.NET
    Validators in ASP.NET 1.x.

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

    "TCORDON" <> wrote in message
    news:%23whyRv%...
    > Is there a way to make the form validation highlight the fields where the
    > errors occur? (change the backcolor of the textboxes)?
    >
    > And second, perform validation without postback and run some Javascript?
    >
    > TIA
    >
    >
    Peter Blum, Oct 24, 2005
    #3
    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. Colin Basterfield

    Web form validation vs object validation

    Colin Basterfield, Nov 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Tommy
    Nov 29, 2003
  2. Sumith Mathur
    Replies:
    0
    Views:
    2,201
    Sumith Mathur
    Sep 23, 2004
  3. OriginalBrownster

    string validation/ form validation

    OriginalBrownster, Aug 21, 2006, in forum: Python
    Replies:
    1
    Views:
    420
    Simon Forman
    Aug 21, 2006
  4. Grigory Temchenko
    Replies:
    0
    Views:
    327
    Grigory Temchenko
    Dec 28, 2008
  5. bnp
    Replies:
    4
    Views:
    318
Loading...

Share This Page