Error: Form elements should not be called "submit"

When submitting the upload form, a warning appears: Error: Form elements must not be named "submit". And no, I don't have form elements called submit . I am using jQuery version 1.3.2.

What is the fix for this?

+4
source share
2 answers

I just saw a problem. This is on line 54 of the jquery.form.js file that says

 $(':input[@name=submit]', form).length 

From API / 1.3 / Selectors , states that

Note. In jQuery 1.3, the style selectors [@attr] were removed (they were previously deprecated in jQuery 1.2). Just remove the @ symbol from your selectors to make them work again.

I probably had a problem when I replaced the jQuery version from 1.2 to 1.3. Now I either have to change this line or replace my version of jquery.form.js.

+7
source

In Form.js, check the code below. You can see this error. Why you can get a popup for error, error code below ...

  if ($(':input[name=submit],:input[id=submit]', form).length) { // if there is an input with a name or id of 'submit' then we won't be // able to invoke the submit fn on the form (at least not x-browser) alert('Error: Form elements must not have name or id of "submit".'); return; } 

So, now you understand why you can get this error, now the solution is very simple.

 Step 1--> Check Your input type="submit" name="submit" id="submit" 

The code does not work on the form, so change something lower than I changed below as long as possible ..

  enter code here input type="submit" name="save" id="save" 

thats it.

+1
source

All Articles