Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ae galera
to com um problema aqui e ja bati cabeça pra resolver mais nao consegui resolver.
bem o que to fazendo.
to fazendo um cadastramento enviando as informações via post com ajax
so que nao estou conseguindo fazer.
ele me mostrar as informações mais nao me aparecer os valores.
meu js ta abaixo.
function trazResult(){
//criando elementos div
var divResp = document.createElement("div");
divResp.id = 'resposta';
pai.appendChild(divResp);
if(ajax.readyState==4){
if(ajax.status==200){
document.getElementById("resposta").innerHTML = ajax.responseText;
}
else{
document.getElementById("resposta").innerHTML = "<center><img src='preload.gif' /></center>";
}
}
}
function add_parecer(formulario){
window.ajax=getObject();
if(ajax==null){
alert('Browser não da suporte a ajax!');
return;
}
var dados = "cheque="+formulario.idcheque.value;
ajax.onreadystatechange=trazResult;
ajax.open("POST", "controle/add_parecer.asp",true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencode");
ajax.send(dados);
return false;
}
estou fazendo em asp.
so pra melhor exibir.
segue abaixo o asp.
<%
dim tipo, parecer, texto, cheque
Response.AddHeader("Content-Type", "text/plain")
' Response.ContentType("text/plain")
' Response.Buffer = false
' Response.Flush
texto = Request.Form("texto")
parecer = Request.Form("parecer")
tipo = Request.Form("tipo")
cheque = Request.Form("cheque")
Response.Write("Texto do Parecer: "& replace(texto,chr(13),"<br>"))
Response.Write("<br>")
Response.Write("Necessita de Parecer Juridico: "& parecer)
Response.Write("<br>")
Response.Write("Tipo de Modificação: "& tipo)
Response.Write("<br>")
Response.Write("Cheque a ser incluido o parecer: "& cheque)
Response.Write("<br>")
%>
seque a parte do form que chamo a função.
<center>
<div id="pai"></div>
<div id="parecer" style="display:none">
<form action="" method="post" name="form1" id="form1" onsubmit="return add_parecer(this);" >
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="451" height="25" bgcolor="#666666" class="style3"><div align="left">Adicionar Parecer </div></td>
<td height="25" bgcolor="#666666"> </td>
</tr>
<tr>
<td height="180" colspan="2" valign="top" bgcolor="#EBEBEB"><table width="760" height="146" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6">
</td>
</tr>
<tr>
<td colspan="6"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="126" class="style4">Parecer Técino </td>
<td width="126" class="style4"> </td>
<td width="126" class="style4"> </td>
<td width="126" class="style4"> </td>
<td width="19" class="style4"><label>
<input name="juri" type="checkbox" id="juri" value="j" />
</label></td>
<td width="237" class="style4">Parecer jurídico </td>
</tr>
<tr>
<td height="300" colspan="6"><label>
<div align="center">
<textarea name="texto" cols="100" rows="20" id="texto"></textarea>
</div>
</label></td>
</tr>
</table>
<div align="right">
<input name="Submit" type="submit" class="style2" value="OK"/>
</div>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" colspan="2"> </td>
</tr>
</table>
</form>
</div>
</center>
se alguem puder ajudar.
fico feliz
ja nao sei o que fazer mais >:D :unsure: http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif
Carregando comentários...