Jquery form submit() question

bubbles

Domainers...
Apr 11, 2007
858
27
0
New to Jquery. Trying to have my function fire when a specific form is submitted.

I have:
Code:
     $(document).ready(function(){
       $("form").submit(function(){

That will fire when any form on the page is submitted though right? How do I specifcy a specific form?
 


Yes thats supposed to trigger when a form is submitted (if you had .submit() instead of .submit(function() { ... it would have caused the form to get submitted once the page was loaded).

You could make it specific by doing $("form#form-id") instead of matching all forms.

JQuery takes css-style identifiers for selectors. Such as $("a.boo") will match all anchors with a class of boo, and so on.

Details here : http://docs.jquery.com/Selectors