Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = $("input[type=submit]").attr("disabled", "disabled");
- $(function(){
- $("input[type=submit]").attr("disabled", "disabled");
- var total = document.getElementById('valor_total'),
- descontado = document.getElementById('valor_descontado'),
- final = document.getElementById('valor_final'),
- vendedor = document.getElementById('vendedor'),
- cliente = document.getElementById('cliente'),
- no_contrato = document.getElementById('contrato'),
- validation;
- var f_total = total.value;
- var f_descontado = descontado.value;
- var f_final = final.value;
- var f_vendedor = vendedor.value;
- var f_cliente = cliente.value;
- var f_no_contrato = no_contrato.value;
- $("#numero_contrato").blur(function() {
- if ( f_vendedor == "0" || f_cliente == "0" || f_no_contrato == "" || f_total == "0,00" || f_final == "0,00") {
- validation = false;
- } else {
- validation = true;
- }
- if (validation = true) {
- $("input[type=submit]").removeAttr("disabled");
- } else {
- $("input[type=submit]").attr("disabled", "disabled");
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement