Solved

Cannot access Form object using JavaScript

Posted on 2007-12-02
3
163 Views
Last Modified: 2008-02-01
I have some pretty basic code here to submit a form (I plan to have it change some items first, but until I can get the submit working - what's the point?)

The code is:

function reschedGame(){
            var x = document.getElementByID("update");
            x.submit();
            
      }

Where update is, in fact, the id of the form. The name of the form is also update.

If I try something like:

function reschedGame(){
            alert("Hey this works!");
      }

The function fires on click.

Any thoughts?
0
Comment
Question by:dirknibleck
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 20392594
Change:
var x = document.getElementByID("update");
to:
var x = document.getElementById("update");

Javascript is case sensitive.
0
 
LVL 29

Assisted Solution

by:Göran Andersson
Göran Andersson earned 250 total points
ID: 20392597
Javascript is case sensetive.

Change getElementByID to getElementById.
0
 
LVL 15

Author Comment

by:dirknibleck
ID: 20392612
I officially feel blind as a bat.

Solutions delivered at exactly the same time (or near enough) so I split it. Thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now