Client side validation of textBox to avoid alloing of white spaces

Rate It (1)

Last post 11-28-2007 5:57 PM by aditya_raj. 4 replies.

Sort Posts:

  • Client side validation of textBox to avoid alloing of white spaces

    11-27-2007, 5:39 PM
    • Loading...
    • aditya_raj
    • Joined on 11-04-2007, 8:33 PM
    • Posts 60

    Hi all,

     

    I have a textbox.I want the user entering white spaces into that textbox.I am thinking of doing that with regular expression validator.

    I can allow a-z chars,A-Z chars,0-9 digits,. and _ symbols in that textbox.

    Can anybody help me how can i do this task.

  • Re: Client side validation of textBox to avoid alloing of white spaces

    11-28-2007, 12:31 AM
    • Loading...
    • marss
    • Joined on 07-19-2007, 11:45 AM
    • Ukraine
    • Posts 151
    <asp:RegularExpressionValidator ... ControlToValidate="TextBox1" ValidationExpression="\w+" ...
  • Re: Client side validation of textBox to avoid alloing of white spaces

    11-28-2007, 1:15 AM
    • Loading...
    • Prabu
    • Joined on 09-30-2006, 11:19 AM
    • Chennai
    • Posts 167

    Hi

    http://regexlib.com is a good place to look for regular expressions

     

    Regards,
    Prabu G

    ~~~ If the reply answered is correct for your question please mark it as answered. This would help people know that the question has been answered. ~~~
  • Re: Client side validation of textBox to avoid alloing of white spaces

    11-28-2007, 11:01 AM
    Answer
    • Loading...
    • marss
    • Joined on 07-19-2007, 11:45 AM
    • Ukraine
    • Posts 151
    marss:
    ValidationExpression="\w+" ...
    I missed "." symbol when I read the question at first time. Correct expression is:
    ValidationExpression="[\.\w]+"
  • Re: Client side validation of textBox to avoid alloing of white spaces

    11-28-2007, 5:57 PM
    • Loading...
    • aditya_raj
    • Joined on 11-04-2007, 8:33 PM
    • Posts 60

    Thanks for your reply.It worked for me.

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter