Cannot access Form object using JavaScript

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?
LVL 15
dirknibleckAsked:
Who is Participating?
 
hieloConnect With a Mentor Commented:
Change:
var x = document.getElementByID("update");
to:
var x = document.getElementById("update");

Javascript is case sensitive.
0
 
Göran AnderssonConnect With a Mentor Commented:
Javascript is case sensetive.

Change getElementByID to getElementById.
0
 
dirknibleckAuthor Commented:
I officially feel blind as a bat.

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

From novice to tech pro — start learning today.