frosty1433
01-10-2007, 12:07 PM
I am having trouble with the following code:
function set_registration_input_event() {
var inputs = document.getElementsByTagName("input");
for (i=0;i<=inputs.length;i++) {
if (inputs[i].className == "registration") {
inputs[i].onclick = function () {inputs[i].style.border = "#6fad00 solid 1px"};
inputs[i].onblur = function () {inputs[i].style.border = "#6a909e solid 1px"};
}
}
}
Error I recieve:
"'className' is null or not an object"
I've tested this on Avant Browser 11 build 43, using the IE 7.0.5730.11 engine.
What I am trying to do is set the onclick and onblur events to change the color of the input field borders for any input tag with "registration" as the class name.
If I'll put somthing like "alert(inputs[i].className)", it works just fine.
An example site can be found on my personal test server:
http://67.182.34.47/mihopa/login/register/
function set_registration_input_event() {
var inputs = document.getElementsByTagName("input");
for (i=0;i<=inputs.length;i++) {
if (inputs[i].className == "registration") {
inputs[i].onclick = function () {inputs[i].style.border = "#6fad00 solid 1px"};
inputs[i].onblur = function () {inputs[i].style.border = "#6a909e solid 1px"};
}
}
}
Error I recieve:
"'className' is null or not an object"
I've tested this on Avant Browser 11 build 43, using the IE 7.0.5730.11 engine.
What I am trying to do is set the onclick and onblur events to change the color of the input field borders for any input tag with "registration" as the class name.
If I'll put somthing like "alert(inputs[i].className)", it works just fine.
An example site can be found on my personal test server:
http://67.182.34.47/mihopa/login/register/