Required Field Validator

Discussion in 'ASP .Net' started by Newbie Coder, Nov 24, 2006.

  1. Newbie Coder

    Newbie Coder Guest

    How do I use a Required Field Validator control in ASP.NET 2.0 to validate
    an e-mail address entered into a textbox control because there is no
    VALIDATION EXPRESSION like in previous versions?

    TIA

    Newbie Coder
     
    Newbie Coder, Nov 24, 2006
    #1
    1. Advertising

  2. That's what the regular expression validator is for. You can use that in
    conjunction with a required field validator.

    --
    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006


    "Newbie Coder" <> wrote in message
    news:...
    > How do I use a Required Field Validator control in ASP.NET 2.0 to validate
    > an e-mail address entered into a textbox control because there is no
    > VALIDATION EXPRESSION like in previous versions?
    >
    > TIA
    >
    > Newbie Coder
    >
    >
     
    Mark Fitzpatrick, Nov 24, 2006
    #2
    1. Advertising

  3. Newbie Coder

    Scott M. Guest

    The previous control didn't have a validation expression property either.
    You are thinking of a regular expression validator.


    "Newbie Coder" <> wrote in message
    news:...
    > How do I use a Required Field Validator control in ASP.NET 2.0 to validate
    > an e-mail address entered into a textbox control because there is no
    > VALIDATION EXPRESSION like in previous versions?
    >
    > TIA
    >
    > Newbie Coder
    >
    >
     
    Scott M., Nov 24, 2006
    #3
  4. Newbie Coder

    Newbie Coder Guest

    Thank you

    But if I add the control you mentioned & type nothing in the textbox
    (txtEmail) then the validator doesn't show. If I type for example 'a' in
    there then it does show. How can I get it to validate an empty textbox
    control too?


    "Newbie Coder" <> wrote in message
    news:...
    > How do I use a Required Field Validator control in ASP.NET 2.0 to validate
    > an e-mail address entered into a textbox control because there is no
    > VALIDATION EXPRESSION like in previous versions?
    >
    > TIA
    >
    > Newbie Coder
    >
    >
     
    Newbie Coder, Nov 24, 2006
    #4
  5. Newbie Coder

    Scott M. Guest

    You need to use 2 validators that both point to the textbox as the
    ControlToValidate. You need to add a RequiredFieldValidator and a
    RegularExpressionValidator with the ValidationExpression property set to
    Internet Email Address.


    "Newbie Coder" <> wrote in message
    news:e$...
    > Thank you
    >
    > But if I add the control you mentioned & type nothing in the textbox
    > (txtEmail) then the validator doesn't show. If I type for example 'a' in
    > there then it does show. How can I get it to validate an empty textbox
    > control too?
    >
    >
    > "Newbie Coder" <> wrote in message
    > news:...
    >> How do I use a Required Field Validator control in ASP.NET 2.0 to
    >> validate
    >> an e-mail address entered into a textbox control because there is no
    >> VALIDATION EXPRESSION like in previous versions?
    >>
    >> TIA
    >>
    >> Newbie Coder
    >>
    >>

    >
    >
     
    Scott M., Nov 24, 2006
    #5
  6. Newbie Coder

    Newbie Coder Guest

    Thank you

    I was thinking the same, but wasn't sure. You have cleared that point up for
    me

    Thanks again

    "Scott M." <> wrote in message
    news:...
    > You need to use 2 validators that both point to the textbox as the
    > ControlToValidate. You need to add a RequiredFieldValidator and a
    > RegularExpressionValidator with the ValidationExpression property set to
    > Internet Email Address.
    >
    >
    > "Newbie Coder" <> wrote in message
    > news:e$...
    > > Thank you
    > >
    > > But if I add the control you mentioned & type nothing in the textbox
    > > (txtEmail) then the validator doesn't show. If I type for example 'a' in
    > > there then it does show. How can I get it to validate an empty textbox
    > > control too?
    > >
    > >
    > > "Newbie Coder" <> wrote in message
    > > news:...
    > >> How do I use a Required Field Validator control in ASP.NET 2.0 to
    > >> validate
    > >> an e-mail address entered into a textbox control because there is no
    > >> VALIDATION EXPRESSION like in previous versions?
    > >>
    > >> TIA
    > >>
    > >> Newbie Coder
    > >>
    > >>

    > >
    > >

    >
    >
     
    Newbie Coder, Nov 24, 2006
    #6
  7. Newbie Coder

    Scott M. Guest

    No problem. How's that hit counter coming along?


    "Newbie Coder" <> wrote in message
    news:...
    > Thank you
    >
    > I was thinking the same, but wasn't sure. You have cleared that point up
    > for
    > me
    >
    > Thanks again
    >
    > "Scott M." <> wrote in message
    > news:...
    >> You need to use 2 validators that both point to the textbox as the
    >> ControlToValidate. You need to add a RequiredFieldValidator and a
    >> RegularExpressionValidator with the ValidationExpression property set to
    >> Internet Email Address.
    >>
    >>
    >> "Newbie Coder" <> wrote in message
    >> news:e$...
    >> > Thank you
    >> >
    >> > But if I add the control you mentioned & type nothing in the textbox
    >> > (txtEmail) then the validator doesn't show. If I type for example 'a'
    >> > in
    >> > there then it does show. How can I get it to validate an empty textbox
    >> > control too?
    >> >
    >> >
    >> > "Newbie Coder" <> wrote in message
    >> > news:...
    >> >> How do I use a Required Field Validator control in ASP.NET 2.0 to
    >> >> validate
    >> >> an e-mail address entered into a textbox control because there is no
    >> >> VALIDATION EXPRESSION like in previous versions?
    >> >>
    >> >> TIA
    >> >>
    >> >> Newbie Coder
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
     
    Scott M., Nov 24, 2006
    #7
  8. Newbie Coder

    Newbie Coder Guest

    Hit counter. What hit counter?



    "Scott M." <> wrote in message
    news:exa$...
    > No problem. How's that hit counter coming along?
    >
    >
    > "Newbie Coder" <> wrote in message
    > news:...
    > > Thank you
    > >
    > > I was thinking the same, but wasn't sure. You have cleared that point up
    > > for
    > > me
    > >
    > > Thanks again
    > >
    > > "Scott M." <> wrote in message
    > > news:...
    > >> You need to use 2 validators that both point to the textbox as the
    > >> ControlToValidate. You need to add a RequiredFieldValidator and a
    > >> RegularExpressionValidator with the ValidationExpression property set

    to
    > >> Internet Email Address.
    > >>
    > >>
    > >> "Newbie Coder" <> wrote in message
    > >> news:e$...
    > >> > Thank you
    > >> >
    > >> > But if I add the control you mentioned & type nothing in the textbox
    > >> > (txtEmail) then the validator doesn't show. If I type for example 'a'
    > >> > in
    > >> > there then it does show. How can I get it to validate an empty

    textbox
    > >> > control too?
    > >> >
    > >> >
    > >> > "Newbie Coder" <> wrote in message
    > >> > news:...
    > >> >> How do I use a Required Field Validator control in ASP.NET 2.0 to
    > >> >> validate
    > >> >> an e-mail address entered into a textbox control because there is no
    > >> >> VALIDATION EXPRESSION like in previous versions?
    > >> >>
    > >> >> TIA
    > >> >>
    > >> >> Newbie Coder
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    Newbie Coder, Nov 24, 2006
    #8
    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. Jinsong Liu

    Required Field Validator Client side popup

    Jinsong Liu, Aug 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,529
    Guenther Liebowitz
    Aug 14, 2003
  2. Do
    Replies:
    3
    Views:
    4,436
    Mike Moore [MSFT]
    Oct 23, 2003
  3. Jim Heavey

    Required Field Validator

    Jim Heavey, Nov 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    Jim Heavey
    Nov 14, 2003
  4. Mr. x
    Replies:
    0
    Views:
    336
    Mr. x
    Nov 30, 2003
  5. jr
    Replies:
    3
    Views:
    449
Loading...

Share This Page