18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Maximum length of a edit box

arunbalaarunbala Members
edited November -1 in Sahi - Open Source
Hi thr,
I just want to find out what is the maximum length of a edit box. Could anyone pls help on this.

thnx

Comments

  • Hi

    http://www.w3schools.com/tags/tag_input.asp says, there is a maxLength attribute. My controller states -1 on an example input field, but i think that means 'no limit'. So:
    $element.maxLength()

    Is this what you are looking for?
    Regards
    Wormi
  • Hi Global,
    Am looking how many cahrs tht the edit box allows. I have tried ur script in the following way. But i could not

    _textarea("ctl00\$ContentPlaceHolder1\$agvMain\$ctl02\$txtDesc").maxLength;

    Pls help on this

    Thnx
  • try _textarea("ctl00\$ContentPlaceHolder1\$agvMain\$ctl02\$txtDesc").maxLength()
  • globalwormingglobalworming Moderators
    edited April 2012
    well.. I am wrong.. have a look at this http://javascript.about.com/library/bltxtmax1.htm
    this is the underlying JS
    function textLimit(field, maxlen) {
      if (field.value.length > maxlen + 1)
      alert('your input has been truncated!');
      if (field.value.length > maxlen)
      field.value = field.value.substring(0, maxlen);
    }
    
    but i see no way to get the maxlength.. well in this particular case you could read the element as Html and look for the onkeyup field and find the number 40
  • im new to this forum thank u for sharing
Sign In or Register to comment.