Try $("#login").submit(); or $("form#login").submit();
$("form #login") tries to find an element with an ID of login INSIDE a
form, rather than the form itself.
Karl Rudd
On 1/17/07, Mungbeans <[EMAIL PROTECTED]> wrote:
>
> I'm posting this in the hope that the mere act will help me work out what it
> is I'm doing wrong. I have a form:
>
> <form action="index.php"
> method="post" name="login" id="login">
> ..etc.
> </form>
>
> with a button that call up the validation function:
>
> function submitLoginForm() {
> if ( ($("#username").val()=="" ) || ($("#passwd").val()=="" )) {
> alert ("Please complete the username and password fields.");
> } else {
> $("form #login").submit();
> }
> }
>
> Form validation works properly but if the fields are ok then the form isn't
> submitting. Probably something obvious...
> --
> View this message in context:
> http://www.nabble.com/Form-not-submitting-tf3025179.html#a8404162
> Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/