This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.
Main navigation:
Search reports by browser:
Setting of the maxlength
attribute with Javascript using the setAttribute()
function doesn't work in Explorer and Opera, while setting other attributes like size
works.
Test page Workaround is not included
Reported by: Henning Jungkurth.
(Orphaned), Explorer 5-6 Windows, Explorer Mac, Opera | Reported on 21 February 2005.
Posted by Mark Deal on 1 March 2005
2The 'l' needs to be capitalised. Use setAttribute('maxLength',5) and it will work fine in IE.
Posted by xarfox on 2 March 2005
3capitalizing the L worked, AWESOME!!
Posted by Hennign Jungkurth on 5 March 2005
4Cool!
Thanks for solving this. I've updated the test page.
Posted by Peter Siewert on 25 February 2005
1Setting maxlength with Javascript using the setAttribute() function will work in Opera if the HTML object has not been added to the DOM model yet. Like this:
var test = document.createElement('INPUT')
test.type = 'text'
test.name = 'setAtt'
test.setAttribute('maxlength', 5);
document.getElementsByTagName('FORM')[0].appendChild(test)
This still doent work for IE