• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Changing maxlength of textfield

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I change the maxlength of a textfield dynamically using javascript.
For eg. As my option varies for a select combo I want to change the maxlength of a text field.
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes u can mofify the maxlength
I hav tested this code/.....
<HTML>
<skript language="javasKript">
funktion changeMaxLen(newLength) {
document.all['pass'].maxLength = newLength;
}
</skript>
<BODY>
<input name="pass" maxlength="3">
<input type="button" value="Change" onKlick= "changeMaxLen('10');">
</BODY>
</HTML>

Ihavechanged 'c' With 'K' at may places as this was not allowing me to post it....
[ November 28, 2003: Message edited by: Andy Smith ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DOCUMENT.ALL IS ONLY IE!!!
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic