|
I'm using Javascript to dynamically create a form on the fly. Firefox can create the form, but when it comes to reading the values in the form i get an error saying that the object has no properties. The code works fine in IE. My guess is that Firefox doesn't know that the form was created and doesnt load their values. In the following example of the code, showForm() works fine. changePass() gives me "newpass has no properties". What do I do?
function showForm(){
getArea = document.getElementById("areatoputform");
getArea.innerHTML = "Old Pass:<input type='password' size='10 id='oldpass' name='oldpass' class='oldpass' /><br>New Pass:<input type='password' size='10 id='newpass' name='newpass' class='newpass' /><br>Confirm: <input type='password' size='10 id='confirm' name='confirm' class='confirm' /><input type='button' name='btnchgpass' value='Change' onClick='changepass();' />"
}
function changepass(){
var oldpass = document.getElementById('oldpass'); //pane where server replies gets placed
var newpass = document.getElementById('newpass'); //pane where server replies gets placed
var confirm = document.getElementById('confirm'); //pane where server replies gets placed
if (newpass.value==confirm.value){...}
}
|