javascript bugged?

Post Reply
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post 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
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
TheCatt
Site Admin
Posts: 58421
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

Post by TheCatt »

Javascript sucks.
It's not me, it's someone else.
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

TheCatt wrote:Javascript sucks.
No shit. The debugging tools suck as well.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post 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.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
Post Reply