Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q966 How can I dynamically alter the maxlength property of a text form field?

You are here: irt.org | FAQ | JavaScript | Form | 11 | Q966 [ previous next ]

Only in Internet Explorer 4+:

<form name="myForm">
<input type="text" name="myField" maxlength="10">
</form>

<script language="JavaScript"><!--
if (document.all)
    document.myForm.myField.maxLength = 5;
//--></script>

©2018 Martin Webb