im trying to make a registration form with ajax validation check.
validation check is OK. i make it show a cross.png image when there is a problem about a field on the form.
but what i wanna do next is to not let visitors apply the registration form when there is problem.
i tried to check for errors by
if(document.getElementById('username_error_icon').innerHTML!='<img src="cross.png" width="15" height="15" />'){
document.form1.submit();
}
which didnt work :/
im open to suggestion
please help :/
The exact innerHTML value of an element isn’t something that is constant accross all browser. You shouldn’t rely on it. Some browser re-order the attribute order, rewrite the path of the “src”.
You should do something along that :