Check if input empty on submit

后端 未结 9 684
谎友^
谎友^ 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:06

    Maybe your condition should be this:

    if($("input.required").val() == '')... //Pay attention to the selector
    

    Cause your selector was finding all inputs children of .required

提交回复
热议问题