Hi everyone,

I'm running into troubles with a simple task.
I want to bind a function to the submit event on a form :
$j(document).ready(
                function(){
                        var oCurrentForm = $j("#syncCountry").parent().get(0);
                        if(oCurrentForm.tagName == 'FORM')
                        {
                                oCurrentForm.submit(function(){alert("toto"); 
return false;} );
                        }
                        else
                        {
                                alert("No form found!10");
                        }
                }
        );

But the form is submiting every time the page is loaded...
What am i doing wrong ?

Thx in advance

Reply via email to