Vishnu R
Vishnu R

Reputation: 1879

What is meant by Javascript error "Uncaught TypeError: Cannot call method 'submit' of undefined"?

What is meant by Javascript error "Uncaught TypeError: Cannot call method 'submit' of undefined"?

I am trying to add an item to cart in my Magneto site. But it shows the above error. Can you point out its meaning or possible reason behind the error such that i can try deeper?

Upvotes: 0

Views: 2914

Answers (3)

Rajesh Bansal
Rajesh Bansal

Reputation: 1

Well, I guess you are trying to submit the form using the submit method. But possibly the form object on which you are trying to call the submit method, is not exists in the document.

May be you mis-typed the form id or name or something like that.

Upvotes: 0

cxk
cxk

Reputation: 1

There's another Stack Overflow question on a similar subject, perhaps this could help you?

Javascript Submit Back to Form

Upvotes: 0

Amadan
Amadan

Reputation: 198496

It is exactly as it says: you have an undefined value, and trying to call a method called submit on it, like this:

undefined.submit();

or like this:

var nonexistent;
nonexistent.submit();

or even like this:

var threeElementArray = [1, 2, 3];
threeElementArray[100].submit();

Why would a library raise it, I don't know. You are not providing much details. It can either be a bug in their code, or more likely you're giving it incorrect parameters somewhere.

Upvotes: 1

Related Questions