myForm.submit not working, don't know why. Need help ASAP

I’m trying to create a form that submits using an <a href=“”> link rather than a submit button, because the submit button in this case is part of a background image, and the link is positioned over the image using CSS.

It worked perfectly fine as a standalone test page. I hit submit, the form posted to the designated php file, the php file sent out an email, everyone went home happy. BUT. Then I tried to add it to the live site.

Now when I click the link nothing happens. The error console is telling me that “vote” (the id of the form) is not defined. But the form is in fact the only item on the page with that ID, and as I said, it worked without problems as a standalone page.

Adding to the problem is the fact that the live site is chock-full of senseless Javascript left there by the previous web designer. I’m not versed in Javascript at all, so I’m at a loss as to whether or not something is conflicting with my code. This is a pretty time sensitive issue-- I need to figure it out by tomorrow evening-- so any help would be much appreciated.

I won’t be able to fully test it until I get back to work and have access to the live site, but testing it locally with firebug is no longer spitting out an “undefined” error for me, which I’ll take as a very good sign.

Good sir, you’re as wise as the man in your icon. :wink:

The link says:


<a href="" onClick="vote.submit();"></a>

The vote variable is currently undefined.

Something like this should work through:


<a href="" onClick="document.getElementById('vote').submit();"></a>