Recently I experience the following problem, when I call this code it triggers an error in FireBug:
With “human” words: I trired to find a input with a spefic name, then find the form wrapping this input and try to submit it. Strangely, but it trows an error in jQuery lib.
The form has the following structure:
Probably some of you will notice that this is search form from WordPress.
I searched in internet and found that there are similar issues in the jQuery bug tracker, but they are closed with “wontfix” message explaining that this is a Dom problem.
Here is the working example of the problem: click. Click on the submit button in the first form and it will do what is shold do, but button “not working” will trigger the error.
Ok, now the solution – find the button submit and trigger a click. Click on the button “working” in the first form in the example and you will see that it will submit properly the value.
Here is the solution:
//or if you know the position of the submit button
The second form doesn’t have input with name or id “submit” and the normal submit() function is triggered correctly.
That’s it. Enjoy!