I have
Code:
. . .
if (document.all["ALT_NUM"].size == 6)
{
document.all["ALT_NUM"].size = 9;
document.all["ALT_NUM"].maxlength = 8;
}
else
{
document.all["ALT_NUM"].size = 6;
document.all["ALT_NUM"].maxlength = 5;
}
. . .
</script>
<body>
. . .
<input type="text" name="ALT_NUM"
size="6" maxlength="5">
. . .
(Obviously I'm showing fragments . . .)
When the code runs, I get the toggling of the size, but the input limit remains at 5 characters.
So. The question:
How can the maxlength of a text input be changed through JScript?
I had equally fruitless results with
Code:
document.all["ALT_NUM"].style.maxlength = 5;