set the length for TextArea

  1. #1

    set the length for TextArea

    for set the textbox length im using these code

    <ext:TextField ID="TextField1" runat="server" MaxLength="14">  
      <CustomConfig>       
     <ext:ConfigItem Name="autoCreate" Value="{tag : 'input', type : 'text', maxlength :14,autocomplete : 'off' }" />  
      </CustomConfig>
    </ext:TextField>
    but for TextArea control it will not work.

    ex: if i enter more than 14 charecters in textarea then it will accepted .what i wnat is if i enter more than 14 charecters then the text area will not take more than 14 charecters

    how to solve these problem plz tell me its urgent.

    Thanks in Advance Dinesh
    Dinesh

  2. #2

    RE: set the length for TextArea

    Hi Dinesh,

    I don't think the maxlength property is supported on the html <textarea> element.


    With the <ext:TextArea> control, you should be able to add a <KeyPress> Listener and limit the number of chars. I think that's how it's typically done with a <textarea> element as well.


    Hope this helps.


    Geoffrey McGill
    Founder
  3. #3

    RE: set the length for TextArea


    can you provide the code for those because i have no idea about what you are saying.


    Plz it's urgent

    Thanks in Advance.
  4. #4

    RE: set the length for TextArea

    Hi Dinesh,

    The following should work.

    Example

    <ext:TextArea ID="TextArea1" runat="server" EnableKeyEvents="true">
        <Listeners>
            <KeyUp Handler="var val = el.getValue(); if (val.length > 14) { return el.setValue(val.substr(0, 14)); }" />
        </Listeners>
    </ext:TextArea>
    Hope this helps.

    Geoffrey McGill
    Founder
  5. #5

    RE: set the length for TextArea


    Thakyou Very much.


    it will work.

Similar Threads

  1. [CLOSED] Measure String Length
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 05, 2012, 10:42 AM
  2. [CLOSED] integers length
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 02, 2011, 1:07 PM
  3. About store Field length
    By supermanok in forum 1.x Help
    Replies: 1
    Last Post: Jul 20, 2009, 8:46 AM
  4. set the length for textbox
    By Dinesh.T in forum 1.x Help
    Replies: 4
    Last Post: May 30, 2009, 2:12 AM
  5. [CLOSED] TextFiled max length
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 29, 2009, 5:13 AM

Posting Permissions