Took me a google search to find this one, but for some reason one of my forms was not submitting using javascript.
The reason was the statement “formObj.submit();” in the javascript was colliding (resulting in ambiguity within the browser) with the form button, which was also named “submit”.
ie:
<input type="submit" name="submit" value="Login">
Change the name of the button to "login" or something else more reflective of it's functionality instead of "submit".
javascript:
function submitForm(formId) {
var formObj = document.getElementById(formId);
formObj.submit();
}
html:
<a href="http://www.homepage.com"
onclick="submitForm('loginForm'); return false">Login</a>
<form id="loginForm">
<input type="submit" name="login" value="Login">
</form>
This article is f***ing amazing, I should hire you at my company!! I have been searching all day for this stupid issue. And of course, with DOT syntax it blows my mind that IE supports this method. Submit is an object of the page, in DOT syntax it should be named differently. Thanks Again – you are a life savor!!
Now, how in the hell to you change all those other stupid f***ing posts on Google so they get it right???
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thanx man. I just spent the last hour wondering why all funktions but submit() worked fine in my form. And there it was: a button named submit…
Well, this’ll teach me to use google first rather than try and figure it out myself.
My wife thanks you for keeping my hair on my head, where it belongs.
Okay, it got me too. Put me down for 5 hours wasted on a Sunday night :)
I’m sure it was a good idea at the time, but what a hunk of junk HTML and JavaScript are. Thanks a bunch W3C. And no Bill Gates that doesn’t mean you are right, you don’t play well with others so you are completely invalid.
Thanks for that. Just saved me hours cause I would not have thought of a name clash!
YOU SOLVED MY PROBLEM!
You rock!
You’re welcome!
Thank you so much – that saved me a lot of time and frusteration – very very much obliged!
Thanks so much. I wasted a whole day on this, but I don’t think I’ll make that mistake again.
Count me as one of the ones you helped. I wasted at least a good hour of my life on this error!
Ryan
I loooooooooooooooooooooooooooooooove you!
gr888888888888 work dude………!!!
dude, you have no idea how much pain that problem caused me… Thanks a billion.
Three hours of searchin my codes and javascripts books about this error, thank you so much, you haved my ***
moty
I know – first thing I should’ve checked when I got the unexplainable was “reserved words”.
Thanks for the tip! I spent an hour trying to figure it out before I googled it. I need to learn to google first.
Thanks!! Luckily, I only lost 40 minutes before I found your incredibly useful article.
Thanks man I love you,
from Mexico with love
It took me about 6 huurs to find your blog, Thanks again.It was so simple all time…
Marko Tulio corona Pacheco
Definitely worth googling this. I wasted about 30 minutes on this before finding your post. Thanks!
Thanks!
Your article is very usefull; In Safari the error is
Object [object INPUT] (result of expression document.form1.submit) does not allow calls.
I f$·%ing HATE JAVASCRIPT SO f$·%ing MUCH.
So incompatible, so weird, you can’t trace the source of the problem quick. Sucks, Sucks and don’t stop sucking.
COKE – why don’t you use the javascript debugger in Firefox? just type “javascript:” in the address bar, then reload the page.
my french isn’t all that great….and your example got truncated COOLDEV, so I’m not sure what you’re trying to show.
Thanks, I was starting to get frustrated :)
I had a submit button named submit and that is what totally jacked my submit code. So all 1001 ways I coded it would never work because document.formname.submit was an object and I guess it found that before finding the submit function? Not sure why but I know what the problem was at least!
– Rit
Thank you for this solution! I’ve been googling this issue for half an hour. Very helpful.
Thankyou! Ive been looking for hours for the reason why my javascript submit isnt working.
This is it. Thanks
Thanks a lot for providing this information.
It solved my problem.
Thanks for this, i was going nuts. :-)
Thanks! You saved my day!!!
You rock !!!!
thank god i did a search on it…lol. saved my life! Thanks
Hey!!
Thanks a lot yaar!! I spent a lot of my time in getting know the error!! Finally got the answer from you!! thanks a lot!! :)
Thank You So Much !!!
THANK YOU !!!!
AWESOME ! Thank you. Just spent the last two hours trying to figure this one out!
THANKS SO MUCH
dang it, i copied some code and it had a button named submit, and i spent
an hour trying to figure out why the heck my js was broken, thanks for the post