Hi, I am tying to change the src of an input image when both fields are filled out in JS and it's not working, I'm starting to think that the src of an input image isn't a valid attribute in JavaScript.
Here's what I have:
......
<script language="JavaScript">
function bChange() {
form = document.form1;
user = form.text1.value;
user = user.replace(" ", "");
pass = form.text2.value;
pass = pass.replace(" ", "");
if(user == "" || pass == "") {
document.form1.submit1.src = "images/image1.gif";
}
if(user != "" && pass != "") {
document.form1.submit1.src = "images/image2.gif";
}
}
</script>
.....
<form name="form1" method="post">
<input name="text1" type="text" size="25" onKeyUp="bChange()">
<input name="text2" type="password" size="25" onKeyUp="bChange()">
<input type="image" name="submit1" src="images/image1.gif">
</form>
On every KeyUp, there is an error that is displayed in the status bar. It's just the default "Error on page" message.