Check whether all textboxes are filled
The two validations are independent.  There's no point to if (codeValue == "" || nameValue == "") { … }.



Instead of calling $.show() and $.hide(), use $.toggle(display):


  display
  Type: Boolean
  Use true to show the element or false to hide it.




You can also write $(function() { … }) instead of $(document).ready(function() { … }).



$(function () {    
    $("#&lt;%= btnInsertCountry.ClientID %&gt;").click(function () {
        $("#divCodeValidation").toggle(
            "" == $("#&lt;%= txtCountryCode.ClientID %&gt;").val()
        );
        $("#divNameValidation").toggle(
            "" == $("#&lt;%= txtCountryName.ClientID %&gt;").val()
        );
    });
});