Won't return form to function
Hey,
Well I have an issue where it's not returning to the function like it should, I'm not sure why not but it wont even alert. See if you can find my error, cause I sure cant. Bah.
Form:
Quote:
<div id="popup">
<form name="login" method="post" action="" onsubmit="return login();">
<p>
<label>Username</label><br>
<input type="text" name="user" class="txt"><br>
<label>Password</label><br>
<input type="password" name="pass" class="txt"><br>
<input type="reset" value="Close" class="btn" onclick="popUp();">
<input type="submit" value="Login" class="btn">
</p>
</form>
</div>
Script:
Quote:
var o;
function login() {
window.o = document.getElementById('popup');
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4) {window.o.innerHTML=xmlhttp.responseText;} };
window.o.innerHTML = 'Attempting to log in...';
xmlhttp.open('GET','../scripts/login.php',true);
xmlhttp.send(null);
return false;
}
Arrrrgh. Stupid mistakes, they irritate the crap outta ya.
Thanks!