forecasting
Programmer
- May 2, 2002
- 130
I want to submit a form using an image for my submit button that changes when the user does a mouseover. When I mouseover with this code I get the error "document[...] is null or not an object." Can anyone help?
<form method="post" action="logic.asp">
<INPUT type="text" name=uname>
<INPUT type="password" name=pwd>
<INPUT type="image" name="img1" SRC="submit.gif" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')">
</form>
<script LANGUAGE="JavaScript">
if (document.images) {
// MouseOver Images
img1on = new Image();
img1on.src = "submitON.gif";
// MouseOut Images
img1off = new Image();
img1off.src = "submit.gif";
}
function imgOn(imgName) { if (document.images) {
document
.src = eval(imgName + "on.src"
;
}}
function imgOff(imgName) { if (document.images) {
document
.src = eval(imgName + "off.src"
;
}}
</script>
<form method="post" action="logic.asp">
<INPUT type="text" name=uname>
<INPUT type="password" name=pwd>
<INPUT type="image" name="img1" SRC="submit.gif" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')">
</form>
<script LANGUAGE="JavaScript">
if (document.images) {
// MouseOver Images
img1on = new Image();
img1on.src = "submitON.gif";
// MouseOut Images
img1off = new Image();
img1off.src = "submit.gif";
}
function imgOn(imgName) { if (document.images) {
document
}}
function imgOff(imgName) { if (document.images) {
document
}}
</script>