2016-11-02 1 views

答えて

0
$(document).ready(function() { 
    $('#update').blur(function() { 
     if ($('#education').val() == "" || $('#education').val()==null) { 
      $("input").focus(function(){ 
      $("#education").css("border-style", "solid").css(" border-color","#ff0000"); 
      }); 
     } 
    }); 
}); 
0

これを試してください:あなたがテキストフィールドにカーソルを置きます

$("input[name='education']").select(); 

本の線に沿って何かを試みることができる

$(document).ready(function() { 
    $('#update').click(function() { 
     if (!$.trim($('#education').val())) { 
      //alert("Please select education"); 
      $('#education').focus(); 
     } 
    }); 
}); 

https://jsfiddle.net/whollands/sgk0v9yf/

0

。 あなたも問題が

ここで強調するために大胆なことを

$("input[name='education']").select().addClass("warning"); 

とスタイル.warningのようなものを持つクラスを追加することができます

関連する問題