regularexpressionvalidator so that user can't fiil spacebar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prp
    New Member
    • Mar 2007
    • 18

    regularexpressionvalidator so that user can't fiil spacebar

    Hi all,
    I have a problem in regularexpressi onvalidator. I need that user can not enter any spacebar into the textbox.
  • keithmdennis
    New Member
    • Mar 2007
    • 3

    #2
    Do you mean you don't want any spaces in the TextBox input? Just numbers and letters and other characters?

    Comment

    • prp
      New Member
      • Mar 2007
      • 18

      #3
      Originally posted by keithmdennis
      Do you mean you don't want any spaces in the TextBox input? Just numbers and letters and other characters?
      yes i need only number in the textbox

      Comment

      • keithmdennis
        New Member
        • Mar 2007
        • 3

        #4
        Originally posted by prp
        yes i need only number in the textbox
        try this:

        1. ^[-]?([1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|\\.[0-9]{1,2})$ for numbers with decimals.

        2. ^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^1000000$ for integers between 1 and 1000000.

        Is this what you were looking for?

        Comment

        • prp
          New Member
          • Mar 2007
          • 18

          #5
          Originally posted by keithmdennis
          try this:

          1. ^[-]?([1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|\\.[0-9]{1,2})$ for numbers with decimals.

          2. ^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^1000000$ for integers between 1 and 1000000.

          Is this what you were looking for?
          yes but if user press any spacebar in the textbox it should give an error message.

          Comment

          • archvivek
            New Member
            • Mar 2007
            • 5

            #6
            hello

            First keep a regular expression validator next ur require textbox.
            Right click and get into the properties.
            set the according properties...
            Control to validate property-(required textbox name)
            Display property-Dynamic
            Error message- required message
            Validate expression property- ^[0-9]*|\d*\d{1}?\d*

            It should work now...

            Like this there are various expresssions for each and every validations.

            Comment

            Working...