Page 1 of 1

Posted: Tue Jan 08, 2008 3:27 pm
by Malcolm
I used to have a form that submitted to a script. It did that the same way many forms do it, w\ submit buttons. However, in an attempt to make the page look less shitty, I replaced the button w\ a graphic that calls javascript's submit function when clicked. I know I'm grabbing my form whether it be from document.myFormName, document.getElementById("myFormId"), or
document.getElementsByName("mfFormName.") cos it returns the correct name, id, & form elements. However, tacking on .submit() to any of the above results in the error that no such function exists.

Coded up a simple example just to make sure JS wasn't fucked up itself. It's not. But there's some shit going on s.t. I cannot grab the form properly cos it's not letting me call submit (which I know exists for form objects in DOM). Has anyone run into this kinda shyte before?




Edited By Malcolm on 1199824268

Posted: Tue Jan 08, 2008 4:23 pm
by TheCatt
Javascript sucks.

Posted: Tue Jan 08, 2008 8:31 pm
by Malcolm
TheCatt wrote:Javascript sucks.
No shit. The debugging tools suck as well.

Posted: Tue Jan 08, 2008 9:46 pm
by Malcolm
This is remarkable. It looks like the javascript DOM model isn't smart enough to differentiate between names of form elements and built-in form functions. In this case, my naming a button "submit" caused it to look up the buttonObject & attempt to execute it. Fucking javascript.