[Javascript] maxLength question

DeWayne Crenshaw decren at yahoo.com
Sat May 19 07:13:33 CDT 2007


Hello,
I am having a problem in establishing maxLength of a
textBox depending on which radioButton is checked. It
seems that IE only establishes maxLength when a page
loads and does not allow you to change it once the
page has loaded.
Although I've tried a lot of manipulations, my rough
code is as follows, 

function changeLength()
{
if (document.myForm.radioButton[1].checked) {maxLength
=5}
else {maxLength =6}
}

<INPUT TYPE=TEXT NAME="textBox" id="textBox"
onfocus="changeLength()">

I'm looking for something that will work cross-browser
and would appreciate any pointers.



       
____________________________________________________________________________________Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz



More information about the Javascript mailing list