Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    22
    Vote Rating
    0
    rufinus is on a distinguished road

      0  

    Question counting string length in textarea

    counting string length in textarea


    Hi,

    i have an textarea with maxlength(text).

    in an ideal world the user is typing the text directly into this field, if he is one char over maxlength the maxlengthtext is displayed, so far so good.
    But most of my users paste text in to this field. If the text is over maxlength, the user sees the error, but doesnt know how many chars he is over the limit.

    I think the easiest way would be to display the current and allowed length in the error message.
    How could this be achieved ?

    Any help would be much appreciated.

    TIA
    Rufinus

  2. #2
    Ext User
    Join Date
    Nov 2007
    Posts
    22
    Vote Rating
    0
    rufinus is on a distinguished road

      0  

    Default


    [push] nobody ?

  3. #3
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611
    Vote Rating
    0
    santosh.rajan is on a distinguished road

      0  

    Default


    Why dont you specify the max length even before the user does anything?

  4. #4
    Ext User
    Join Date
    Nov 2007
    Posts
    22
    Vote Rating
    0
    rufinus is on a distinguished road

      0  

    Default


    Hi,

    maxlength IS definied. and remember this is an textarea not a textfield. (no html maxsize)

    if a user paste in a text with more chars then allowed, the user is getting the error message, but dont know how much chars he is over the limit. This is the only problem i want to come by, in displaying the chars in the textarea field in the errormessage.
    eg. "In this field are only 250 chars allowed. Current: 284"

    Rufinus

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    You should be able to specify a custom validation function via the validator config in which you build the message based on how many characters have been entered.

  6. #6
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    Location
    "A Land Down Under"
    Posts
    618
    Vote Rating
    1
    catacaustic is on a distinguished road

      0  

    Default


    This is more of an event issue then anything else. Because the user cuts & pastes into the field, there isn't any events thrown to check with. The only suggestion that I'd have for this is to set a blue vent listener to check for the maxlength as well, and if it's over, mark the field as invalid and show the error message. It's a little bit longer to do, but it'll do what you want it to.
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder