Advertisement
paulocentr

Untitled

Jul 3rd, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = $("input[type=submit]").attr("disabled", "disabled");
  2.     $(function(){  
  3.                         $("input[type=submit]").attr("disabled", "disabled");
  4.                         var total = document.getElementById('valor_total'),
  5.                         descontado = document.getElementById('valor_descontado'),
  6.                         final = document.getElementById('valor_final'),
  7.                         vendedor = document.getElementById('vendedor'),
  8.                         cliente = document.getElementById('cliente'),
  9.                         no_contrato = document.getElementById('contrato'),
  10.                         validation;
  11.                        
  12.                             var f_total = total.value;
  13.                             var f_descontado = descontado.value;
  14.                             var f_final = final.value;
  15.                             var f_vendedor = vendedor.value;
  16.                             var f_cliente = cliente.value;
  17.                             var f_no_contrato = no_contrato.value;
  18.                            
  19.                             $("#numero_contrato").blur(function() {
  20.                                    
  21.                             if ( f_vendedor == "0" || f_cliente == "0" || f_no_contrato == "" || f_total == "0,00" || f_final == "0,00") {
  22.                             validation = false;
  23.                             } else {
  24.                             validation = true;
  25.                             }
  26.                             if (validation = true) {
  27.                             $("input[type=submit]").removeAttr("disabled");
  28.                             } else {
  29.                             $("input[type=submit]").attr("disabled", "disabled");
  30.                             }
  31.                             });
  32.                     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement