I have a very simple form (.cfm page). I'm submitting the form via AJAX in my javascript file. The form works fine in IE, Safari and Chrome, but doesn't work in FF (v18.0).
Here is my form:
<form name="LoginForm">
<input class="newstext" type="text" name="userLogin" id="userLogin">
<input class="newstext" type="password" name="passLogin" id="passLogin">
<input type="button" name="login" value=" Login " onClick="validateLogin();">
</form>
Javascript code:
function validateLogin() {
if (document.getElementById('userLogin').value == '') {
alert('Please enter your username');
document.getElementById('userLogin').style.backgroundColor='yellow';
document.getElementById('userLogin').focus();
return false;
}
if (document.getElementById('passLogin').value == '') {
alert('Please enter your password');
document.getElementById('passLogin').style.backgroundColor='yellow';
document.getElementById('passLogin').focus();
return false;
}
ColdFusion.Ajax.submitForm("LoginForm", "loginForm_action.cfm", submitLoginCallback, submitLoginerrorHandler);
return true;
}
When I try to login in, the form element values aren't being passed. So when it hits the cfc, the cfc says "Element USERLOGIN is undefined in FORM.
The error occurred on line 9." Any ideas?
The error occurred on line 9. – David Jacobson Jan 10 '13 at 02:19