document.getElementById('form_name').submit() not working properly
- by Leahn Novash
Ok, I will try to give the most details I can.
The site is not suposed to work with IE6. It would be nice if it worked with IE8 and Chrome, but that can be done later.
The site is in PHP. The form where the submit is in another PHP file that is included in position on the index.php inside of a DIV tag.
If I open the form solely, the submit works correcly, but when I try to submit on the index page, the Firefox error console says that document is undefined. The form code is echoed line by line via PHP. Save the text fields for username and password, the form code is the following:
<form id="entrar" action="entrar.php" method="post" onsubmit="javascript:checkvalues();">
<a href="javascript:document.getElementById('entrar').submit();">ENTRAR</a>
</form>
What's the big deal? What am I missing here? I know it is something very silly but I can't figure it out.