Form field error messages

Discussion in 'ASP .Net Web Services' started by Shabam, Sep 5, 2004.

  1. Shabam

    Shabam Guest

    I know that dotnet allows for form field validation. However I'm looking to
    customize the error message display and am wondering if it's possible to do
    what I need.

    Example:

    Suppose in a form there is a "Name" field (required). The user leaves it
    blank and submits the form. I need to reload the page with the "Name" in
    red so the user can see which field(s) have errors in them.

    Second, at the top of the page I need a table displaying a descriptive error
    message. That table would be customized of course.

    I've been told that dotnet does the error output dynamically via client end
    script, then server end script if user has turned off javascript. I was
    also told that dotnet has limitations in terms of customizing it the way
    I've described.

    Is this true? If not how does one go about customizing it like I've stated?
     
    Shabam, Sep 5, 2004
    #1
    1. Advertising

  2. Shabam

    Hermit Dave Guest

    you have validation controls that you can use in asp.net.
    if you have vs.net... you will find them in the toolbox where you can drop
    them on to aspx in the designer.

    RequiredFieldValidator does what it says... if you assign a control to it...
    the user has to populate the control.. like a text box and only then it will
    allow form submission.
    you have other validation controls like RangeValidation Regular Expressions
    Validator etc. you can specify what you want...

    you have validation summary control that automatically does a list of error
    messages from validation controls.

    you can customise error messages and even write your own validations. have a
    look at the links

    http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx

    http://www.codeproject.com/useritems/ValidatorCtrl_by_VIVEK.asp

    http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=46

    http://www.4guysfromrolla.com/webtech/090200-1.shtml

    http://www.15seconds.com/issue/030211.htm

    HTH
    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Shabam" <> wrote in message
    news:...
    > I know that dotnet allows for form field validation. However I'm looking

    to
    > customize the error message display and am wondering if it's possible to

    do
    > what I need.
    >
    > Example:
    >
    > Suppose in a form there is a "Name" field (required). The user leaves it
    > blank and submits the form. I need to reload the page with the "Name" in
    > red so the user can see which field(s) have errors in them.
    >
    > Second, at the top of the page I need a table displaying a descriptive

    error
    > message. That table would be customized of course.
    >
    > I've been told that dotnet does the error output dynamically via client

    end
    > script, then server end script if user has turned off javascript. I was
    > also told that dotnet has limitations in terms of customizing it the way
    > I've described.
    >
    > Is this true? If not how does one go about customizing it like I've state

    d?
    >
    >
    >
     
    Hermit Dave, Sep 5, 2004
    #2
    1. Advertising

  3. Shabam

    Shabam Guest

    "Hermit Dave" <> wrote in message
    news:...
    > you have validation controls that you can use in asp.net.
    > if you have vs.net... you will find them in the toolbox where you can drop
    > them on to aspx in the designer.
    >
    > RequiredFieldValidator does what it says... if you assign a control to

    it...
    > the user has to populate the control.. like a text box and only then it

    will
    > allow form submission.
    > you have other validation controls like RangeValidation Regular

    Expressions
    > Validator etc. you can specify what you want...
    >
    > you have validation summary control that automatically does a list of

    error
    > messages from validation controls.
    >
    > you can customise error messages and even write your own validations. have

    a
    > look at the links


    Thanks for the input. I understand there are server validation controls in
    vs.net. However I need to customize them to my needs. As I understand it,
    error messages appear after the control. I would like to just change the
    font color of the heading to red. Also, at the top of the page, I need to
    print out the exact errors, but surround the messages with my custom table
    and graphic. How do I go about doing such? Thanks.
     
    Shabam, Sep 6, 2004
    #3
  4. Shabam

    Hermit Dave Guest

    The validation controls have two properties.. one is Error Message and the
    other one is Text
    If you populate both and have a Summary Control then...
    the Text is display next on the validation control
    the Error message is displayed in the summary control.

    if you want the error message in Red.. then just set the Validation /
    Summary Control's CssClass to the right style.

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Shabam" <> wrote in message
    news:...
    > "Hermit Dave" <> wrote in message
    > news:...
    > > you have validation controls that you can use in asp.net.
    > > if you have vs.net... you will find them in the toolbox where you can

    drop
    > > them on to aspx in the designer.
    > >
    > > RequiredFieldValidator does what it says... if you assign a control to

    > it...
    > > the user has to populate the control.. like a text box and only then it

    > will
    > > allow form submission.
    > > you have other validation controls like RangeValidation Regular

    > Expressions
    > > Validator etc. you can specify what you want...
    > >
    > > you have validation summary control that automatically does a list of

    > error
    > > messages from validation controls.
    > >
    > > you can customise error messages and even write your own validations.

    have
    > a
    > > look at the links

    >
    > Thanks for the input. I understand there are server validation controls

    in
    > vs.net. However I need to customize them to my needs. As I understand

    it,
    > error messages appear after the control. I would like to just change the
    > font color of the heading to red. Also, at the top of the page, I need to
    > print out the exact errors, but surround the messages with my custom table
    > and graphic. How do I go about doing such? Thanks.
    >
    >
     
    Hermit Dave, Sep 6, 2004
    #4
    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. Shabam

    Form field error messages

    Shabam, Sep 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    453
    Hermit Dave
    Sep 6, 2004
  2. NotGiven
    Replies:
    3
    Views:
    387
    Michael D. Kersey
    May 13, 2004
  3. GavMc
    Replies:
    4
    Views:
    378
    Evertjan.
    Sep 22, 2005
  4. NotGiven
    Replies:
    3
    Views:
    328
    Michael D. Kersey
    May 13, 2004
  5. Sound
    Replies:
    2
    Views:
    498
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page