Results 1 to 6 of 6

Thread: [Solved] Textfield getting validation for space !

  1. #1
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Exclamation [Solved] Textfield getting validation for space !

    Hi,

    I am having a textfield in the form panel with required config set to true. The form gets submitted if I enter black space, however it shows proper validation message if I don't enter anything and try to submit.

    My requirement is like :-

    Valid : "aaa", "aaa bbb"
    Invalid : " "

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    120
      0  

    Default

    So you are looking for this?

  3. #3
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Default

    Its difficult for the user to type in as it keep on croping the last space while the user is typing...

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    120
      0  

    Default

    You could switch the validationEvent from 'keyup' to false (validateOnBlur is still true).

  5. #5
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Thumbs up [SOLVED]

    thanks for the help condor....

    Currently i am not worrying about the end space character/s. So the code :-

    Code:
    stripCharsRe:/(^\s+$)/g,
    done the trick.

  6. #6
    Ext User
    Join Date
    Sep 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default

    Another option is to add the following regular expresion to validate that there is something other than spaces in the value.

    regex:/[^\s]/,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •