Advertisement
son86000

validacao-anunciante.js

Aug 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $("#cadastro-anunciante").ready(function(){
  2.  
  3.    //razao social
  4.    $(".razaosocial").focus(function(){
  5.       if($(".razaosocial").focus() == ' '){
  6.         $(".razaosocial").css("background-color","red");
  7.         $(".btn-cadastrar").attr("disabled");
  8.        
  9.         return false;
  10.       }
  11.  
  12.       else{
  13.         $(".btn-cadastrar").removeAttr("disabled");
  14.       }
  15.    });
  16.  
  17.    //inscricao municipal
  18.    $(".ins_municipal").focus(function(){
  19.       if($(".ins_municipal").focus() == ' '){
  20.         $(".ins_municipal").css("background-color","red");
  21.         $(".btn-cadastrar").attr("disabled");
  22.  
  23.         return false;
  24.       }
  25.  
  26.       else{
  27.         $(".btn-cadastrar").removeAttr("disabled");
  28.       }
  29.    });
  30.  
  31.    //rendereco de cobranca
  32.    $(".end_cobranca").focus(function(){
  33.       if($(".end_cobranca").focus() == ' '){
  34.         $(".end_cobranca").css("background-color","red");
  35.         $(".btn-cadastrar").attr("disabled");
  36.  
  37.         return false;
  38.       }
  39.  
  40.       else{
  41.         $(".btn-cadastrar").removeAttr("disabled");
  42.       }
  43.    });
  44.  
  45.    //cep
  46.    $(".cep").focus(function(){
  47.       if($(".cep").focus() == ' '){
  48.         $(".cep").css("background-color","red");
  49.         $(".btn-cadastrar").attr("disabled");
  50.  
  51.         return false;
  52.       }
  53.  
  54.       else{
  55.         $(".btn-cadastrar").removeAttr("disabled");
  56.       }
  57.    });
  58.  
  59.    //bairro
  60.    $(".bairro").focus(function(){
  61.       if($(".bairro").focus() == ' '){
  62.         $(".bairro").css("background-color","red");
  63.         $(".btn-cadastrar").attr("disabled");
  64.  
  65.         return false;
  66.       }
  67.  
  68.       else{
  69.         $(".btn-cadastrar").removeAttr("disabled");
  70.       }
  71.    });
  72.  
  73.    //numero
  74.    $(".numero").focus(function(){
  75.       if($(".numero").focus() == ' '){
  76.         $(".numero").css("background-color","red");
  77.         $(".btn-cadastrar").attr("disabled");
  78.  
  79.         return false;
  80.       }
  81.  
  82.       else{
  83.         $(".btn-cadastrar").removeAttr("disabled");
  84.       }
  85.    });
  86.  
  87.  
  88.    //inscricao estadual
  89.    $(".ins_estadual").focus(function(){
  90.       if($(".estadual").focus() == ' '){
  91.         $(".estadual").css("background-color","red");
  92.         $(".btn-cadastrar").attr("disabled");
  93.  
  94.         return false;
  95.       }
  96.  
  97.       else{
  98.         $(".btn-cadastrar").removeAttr("disabled");
  99.       }
  100.    });
  101.  
  102.  
  103.    //cnpj
  104.    $(".cnpj").focus(function(){
  105.       if($(".cnpj").focus() == ' '){
  106.         $(".cnpj").css("background-color","red");
  107.         $(".btn-cadastrar").attr("disabled");
  108.  
  109.         return false;
  110.       }
  111.  
  112.       else{
  113.         $(".btn-cadastrar").removeAttr("disabled");
  114.       }
  115.    });
  116.  
  117.  
  118.    //endereco
  119.    $(".endereco").focus(function(){
  120.       if($(".endereco").focus() == ' '){
  121.         $(".endereco").css("background-color","red");
  122.         $(".btn-cadastrar").attr("disabled");
  123.  
  124.         return false;
  125.       }
  126.  
  127.       else{
  128.         $(".btn-cadastrar").removeAttr("disabled");
  129.       }
  130.    });
  131.  
  132.  
  133.    //cidade
  134.    $(".cidade").focus(function(){
  135.       if($(".cidade").focus() == ' '){
  136.         $(".cidade").css("background-color","red");
  137.         $(".btn-cadastrar").attr("disabled");
  138.  
  139.         return false;
  140.       }
  141.  
  142.       else{
  143.         $(".btn-cadastrar").removeAttr("disabled");
  144.       }
  145.    });
  146.  
  147.  
  148. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement