Check if input empty on submit

后端 未结 9 761
谎友^
谎友^ 2020-12-25 08:36

I\'ve been looking around for a solution to this, but can\'t seem to find any examples that work for me. Here\'s what I\'ve got so far:

$(\"#register-form\")         


        
9条回答
  •  星月不相逢
    2020-12-25 09:12

    This code get all form fields with select list & checkbox etc.

    var save_prms = $("form").serializeArray();
        $(save_prms).each(function( index, element ) {
            alert(element.name);
            alert(element.val);
        });
    

提交回复
热议问题