That will only submit if form is the first-child of it's parent (in
the DOM).  Can you verify that's the case?

alert( $("form:first").length ); // or something

On May 21, 12:51 pm, l3kris <jcj...@gmail.com> wrote:
> I have this function that validates and is supposed to submit a simple
> form:
>
> $(function() {
> $('#godkend').click(function() {
>   if($('#Select1').val() == "") {
>     alert('Du har ikke valgt første');
>   } else if($('#Select2').val() == "" && $('#Select2').is(':visible'))
> {
>     alert('Du har ikke valgt anden');
>   } else if($('#Select3').val() == "" && $('#Select3').is(':visible'))
> {
>     alert('Du har ikke valgt tredje');
>   } else {
>     alert('fint');
>     $("form:first").submit();
>   }
>
> });
> });
>
> The validation works fine, but the submitting doesn't. The test (alert
> ('fint')) pops up allright, so what should I change?

Reply via email to