The custom function formdvalidate should run after else but it doesn't. How can I trigger it to run? What I like to accomplish here is to check the text-fields of a form. If there are less then 3 characters its show the user some text. If the input is more then 3 it submits the form.
--I was thinking to wrong way, this works better.
$('#submit').click(formdvalidate);
The function
function formdvalidate(){
$(".form-sel").each(function(){
var n = $(this).closest('.contain-form').find('.custom:first').val().length;
if ($('option:selected', this).val() === 'custom' && n < 3) {
$(this).closest('.contain-form').find('.alert-short:first').show();
}else{
$('#poll').submit();
}
});
}
clickhandler will never gettrueas an argument.