mandatory text fields

Discussion in 'ASP .Net' started by Srinivas, Mar 22, 2005.

  1. Srinivas

    Srinivas Guest

    Hi,

    If a textbox is being validated using a required field validator then we
    need to key in some text before sumbmitting the form. But if we key in a
    space character this gets validated to true and the form gets submitted. I
    want to make sure that the user enters some text and submit the form, and
    not just enter a space character and submitting the form.

    Any ideas how to achieve this.

    Thanks,

    Srinivas
    Srinivas, Mar 22, 2005
    #1
    1. Advertising

  2. Srinivas

    Karl Seguin Guest

    Srinivas:
    You could certainly achieve what you are looking for with a mix of a
    RequiredFieldValidator as well as a RegularExpressionValidator...I'd give
    you a regular expression, but what's your meaning of "some text" ??
    Numbers? Letters? Punctuation? Anything non space?

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)


    "Srinivas" <> wrote in message
    news:...
    > Hi,
    >
    > If a textbox is being validated using a required field validator then we
    > need to key in some text before sumbmitting the form. But if we key in a
    > space character this gets validated to true and the form gets submitted. I
    > want to make sure that the user enters some text and submit the form, and
    > not just enter a space character and submitting the form.
    >
    > Any ideas how to achieve this.
    >
    > Thanks,
    >
    > Srinivas
    >
    >
    Karl Seguin, Mar 22, 2005
    #2
    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. valentin tihomirov

    mandatory output binding?

    valentin tihomirov, Jul 2, 2005, in forum: VHDL
    Replies:
    1
    Views:
    471
    Jonathan Bromley
    Jul 4, 2005
  2. Pete Barrett
    Replies:
    0
    Views:
    549
    Pete Barrett
    Jun 8, 2005
  3. Chris West

    XSD mandatory element

    Chris West, Jun 27, 2003, in forum: XML
    Replies:
    1
    Views:
    5,928
    Colin Mackenzie
    Jun 27, 2003
  4. Ollie

    mandatory fields....

    Ollie, Oct 13, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    189
    Dan Rogers
    Nov 16, 2004
  5. MT

    making a text field mandatory?

    MT, Oct 9, 2003, in forum: Javascript
    Replies:
    4
    Views:
    168
Loading...

Share This Page