skdzines
01-29-2005, 01:47 PM
I am using php to validate and submit a form. I am trying to use a rollover image to submit the form. I have the following code that works perfectly on another site I have done which I copied to the site I am currently working on. The code is as follows:
<form name="contact" method="post" action="<? $PHP_SELF ?>">
//form elements here....
<a href="#" onClick="document.contact.submit();" onMouseOver="document.contact.SubmitIMG.src='contact/images/submitFormOn.gif';" onMouseOut="document.contact.SubmitIMG.src='contact/images/submitFormOff.gif';">
<img src="contact/images/submitFormOff.gif" name="SubmitIMG" width="74" height="18" border="0" id="SubmitIMG"></a>
</div></td><input type="hidden" name="form" value="contact">
</tr>
</table>
</form>
For some reason I get this error when I rollover or click the submit button image.
Line: 210
Char: 1
Error: 'document.contact.SubmitIMG' is null or not an object.
I don't understand why I am receiving this error. Like I said I basically copied the code from another site I did and just changed the path to the image I need to use. The form names and everything else are the same.
Any ideas? Please help!!!
Thanks
<form name="contact" method="post" action="<? $PHP_SELF ?>">
//form elements here....
<a href="#" onClick="document.contact.submit();" onMouseOver="document.contact.SubmitIMG.src='contact/images/submitFormOn.gif';" onMouseOut="document.contact.SubmitIMG.src='contact/images/submitFormOff.gif';">
<img src="contact/images/submitFormOff.gif" name="SubmitIMG" width="74" height="18" border="0" id="SubmitIMG"></a>
</div></td><input type="hidden" name="form" value="contact">
</tr>
</table>
</form>
For some reason I get this error when I rollover or click the submit button image.
Line: 210
Char: 1
Error: 'document.contact.SubmitIMG' is null or not an object.
I don't understand why I am receiving this error. Like I said I basically copied the code from another site I did and just changed the path to the image I need to use. The form names and everything else are the same.
Any ideas? Please help!!!
Thanks