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?