LoginSignup
4
4

More than 5 years have passed since last update.

複数のセレクトボックスが全て選択されているかでバリデーションするJquery

Posted at
js
$(function () {
   //送信ボタンを押したときにバリデーション
   $(".submit_button").click(function(){
      if($("#selectbox_wrapper1").find('option:selected').val()=="" ||
         $("#selectbox_wrapper2").find('option:selected').val()=="" {
            alert("セレクトボックスが全て選択されていません");
            return false;
        }
   }
});

htmlは省略

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4