Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Adriano,
me da um help aqui!
Tipo eu comecei a fazer e como os dois Ajax são no mesmo form eu mudei os nomes das funções tipo uma ta ajax a outra eu coloquei ajaxx e o nome do arquivo tb...
Veja se assim ta certo!
Ajaxx.JS
function ajaxx() {};ajaxx.prototype.iniciar = function() { try{ this.xmlhttp = new XMLHttpRequest(); }catch(ee){ try{ this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(E){ this.xmlhttp = false; } } } return true;}ajaxx.prototype.ocupado = function() { estadoAtual = this.xmlhttp.readyState; return (estadoAtual && (estadoAtual < 4));}ajaxx.prototype.processa = function() { if (this.xmlhttp.readyState == 4 && this.xmlhttp.status == 200) { return true; }}ajaxx.prototype.enviar = function(url, metodo, modo) { if (!this.xmlhttp) { this.iniciar(); } if (!this.ocupado()) { if(metodo == "GET") { this.xmlhttp.open("GET", url, modo); this.xmlhttp.send(null); } else { this.xmlhttp.open("POST", url, modo); this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); this.xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate"); this.xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0"); this.xmlhttp.setRequestHeader("Pragma", "no-cache"); this.xmlhttp.send(url); } if (this.processa) { return unescape(this.xmlhttp.responseText.replace(/\+/g," ")); } } return false;}function enviaa(url, metodo, modo){ var cpf = document.getElementById('cpf').value; remoto = new ajaxx(); xmlhttp = remoto.enviar(url + "?cpf=" + cpf, metodo, modo); if(xmlhttp) { alert("Nunca foi contratado pela NewStyle"); document.getElementById("Enviar").disabled = false; } else { document.getElementById("Enviar").disabled = false; }}
calculaa.asp
<%cpfultimo = request("cpf")Sqlcpf = "Select * From ficha_de_pessoal where cpf='"&cpfultimo&"'"Set rscpf = Conexcao.Execute(sqlcpf)If cpfultimo = rscpf("cpf") Then response.Write falseElseResponse.Write(rscpf("data_inicio"))End if%>
Ta ok?
Carregando comentários...