Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

shumi

select exibe as outras informações

Recommended Posts

Bem então seu form anterior está com algum problema, pois esta listando nomes fantasias para carteiras "erradas".

Salgado eu to testando direto no endereco do Remote.asp eu so chamo esse arquivo que está assim:
<%set Conexcao = Server.CreateObject("ADODB.Connection")Conexcao.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MaPpath("banco\db_chopp_brahma.mdb")SQL = "SELECT fantasia, endereco, uf, cidade, ddd1, tel1, ddd2, tel2, contato, email, proprietario from cad_bares WHERE carteira ='"& Session("login") &"' AND fantasia='"& Request.QueryString("fantasia") &"';"set rs = server.CreateObject("ADODB.Recordset")  Conexcao.open   rs.CursorType = 3   rs.Open SQL, Conexcao '  rs.MoveFirst%>  <script>  loc = new Array(<%=rs.recordcount%>)  for (i=0; i < <%=rs.recordcount%>; i++) {		 loc[i] = new Array(11) //troquei de 2 para 11, que será o seu número de campos				 for (j=0; j < 11; j++) {// o mesmo que o anterior, no lugar de j < 2			 loc[i][j] = "0"		   }   }   <% j = 0	 do while not rs.eof%>	loc[<%=j%>][0] = "<%=trim(rs("fantasia"))%>";	loc[<%=j%>][1] = "<%=trim(rs("endereco"))%>";	loc[<%=j%>][2] = "<%=trim(rs("uf"))%>";	loc[<%=j%>][3] = "<%=trim(rs("cidade"))%>";	loc[<%=j%>][4] = "<%=trim(rs("ddd1"))%>";	loc[<%=j%>][5] = "<%=trim(rs("tel1"))%>";	loc[<%=j%>][6] = "<%=trim(rs("ddd2"))%>";	loc[<%=j%>][7] = "<%=trim(rs("tel2"))%>";	loc[<%=j%>][8] = "<%=trim(rs("contato"))%>";	loc[<%=j%>][9] = "<%=trim(rs("email"))%>";	loc[<%=j%>][10] = "<%=trim(rs("proprietario"))%>";// vai repetindo para cada campo que queira acrescentar e alterando o numero do 2º colchete.	  <%	  rs.movenext	  j  = j  + 1	 loop   rs.close  set rs = nothing   Conexcao.close   set Conexcao = nothing %>   parent.inicia();  </script>
Como eu posso testar algo para tentar funfar Salgado?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Para funcionar tu tem que mandar um "Fantasia" que seja da "Carteira", assim deveria funcionar.

Compartilhar este post


Link para o post
Compartilhar em outros sites

hummmm entendi o que você queria dizer!

e Funfou no remote.asp apareceu certinho quando mandei exibir o cod de fonte!

Agora pra adaptar no form eu tenho no comeco um JS. ai esta assim:

 

<script language="JavaScript" type="text/JavaScript">	function carregar(){	Combo1 = document.Cadastro.cod; //ALTERE AQUI PARA SEU FORM E 1º SELECT	Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?cod='+Combo1[Combo1.selectedIndex].value;	Combo2.options.length = 0;	addItem(Combo2,"Aguarde...carregando","",false,Combo2.length)	myIframe.location = url;	Combo2.focus()	}		function inicia(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	maximo1 = local1.length;	Combo2.options.length = 0;	//addItem(Combo2,false,Combo2.length);	for (i=0;i<maximo1;i++){	addItem(Combo2,local1[i][1],local1[i][0],false,Combo2.length);	}	}
Como que eu posso adaptar isso, para a quantidade de campos que tenho???

tem muita coisa nesse script que não entendi!! http://forum.imasters.com.br/public/style_emoticons/default/ermm.gif/>

 

 

hummmm entendi o que você queria dizer!

e Funfou no remote.asp apareceu certinho quando mandei exibir o cod de fonte!

Agora pra adaptar no form eu tenho no comeco um JS. ai esta assim:

 

<script language="JavaScript" type="text/JavaScript">	function carregar(){	Combo1 = document.Cadastro.cod; //ALTERE AQUI PARA SEU FORM E 1º SELECT	Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?cod='+Combo1[Combo1.selectedIndex].value;	Combo2.options.length = 0;	addItem(Combo2,"Aguarde...carregando","",false,Combo2.length)	myIframe.location = url;	Combo2.focus()	}		function inicia(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	maximo1 = local1.length;	Combo2.options.length = 0;	//addItem(Combo2,false,Combo2.length);	for (i=0;i<maximo1;i++){	addItem(Combo2,local1[i][1],local1[i][0],false,Combo2.length);	}	}
Como que eu posso adaptar isso, para a quantidade de campos que tenho???

tem muita coisa nesse script que não entendi!! http://forum.imasters.com.br/public/style_emoticons/default/ermm.gif/>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Teremos que criar novos JS, um para no onchange do 2º SELECT executar no Iframe o seu Remote.asp "novo" e uma nova function Inicia.

Compartilhar este post


Link para o post
Compartilhar em outros sites

então eu tenho que criar assim?- 1º fantasia que "seleciona" o endereço- 2º endereço que "seleciona" o numero- 3º numero que "seleciona" a UF- 4º UF que "seleciona" a cidade.e assim vai.... é isso?dá pra colocar os valores dento de um campo tipo texto né?e isso que você me explicou??Abs

Compartilhar este post


Link para o post
Compartilhar em outros sites

Todos os campo serão tipo texto ou terá SELECTS no meio?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Todos os campo serão tipo texto ou terá SELECTS no meio?

O fantasia que é o primeiro vai ser um select, a UF e a cidade eu queria fazer um select tb, mas não sei se é possivel, pois eu tenho um arquivo em JS que o user escolhe a UF e aparece as cidades somente da Uf selecionada, não sei se dá para ligar tudo, mas seria esses campo, se der, se não der será somente o fantasia que será select!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Vamos tentar: no seu Select Fantasia acrescente um OnBlur="CarregaDados();"

<script language="JavaScript" type="text/JavaScript">	
function CarregaDados(){	
Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	
var url;	
url = 'remote.asp?fantasia='+Combo2[Combo2.selectedIndex].value;	
myIframe.location = url;	
Combo2.focus()	
}	

function inicia(){	
local1 = new Array();	
var maximo1, i;	
local1 = myIframe.loc;	

document.getElementById("endereco").Value = local1[0][1]; //Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

é assim o JS???

 

<script language="JavaScript" type="text/JavaScript">	function CarregaDados(){	Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?fantasia='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}		function inicia(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("endereco").Value = local1[0][1];document.getElementById("uf").Value = local1[1][2];document.getElementById("cidade").Value = local1[2][3];document.getElementById("ddd1").Value = local1[3][4];document.getElementById("tel1").Value = local1[4][5];document.getElementById("ddd2").Value = local1[6][7];document.getElementById("tel2").Value = local1[8][9];document.getElementById("contato").Value = local1[10][11];document.getElementById("email").Value = local1[11][12];document.getElementById("proprietario").Value = local1[12][13];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.</script>

Compartilhar este post


Link para o post
Compartilhar em outros sites

O 1º Colchete vai ser sempre 0.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Arrumei!!!

 

Salgado,

o Iframe eu não preciso fazer nenhuma modificação ou tenho que fazer um Iframe pra cada campo???

tá assim olha:

 

<div style="DISPLAY: none; POSITION: absolute" align="left"><IFRAME src name="myIframe" id="myIframe" width="400" height="100" marginwidth="0" marginheight="0"></IFRAME></div>

Valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

Só esse mesmo.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,Cara eu fiz assim:

<!--#include file="conexao.asp"--><%IF Not(Session("logado")) ThenResponse.Redirect "index.asp"Response.EndEnd IFSql = "Select * from cad_bares"Set rs = Conexcao.Execute(Sql)%><html><head><title>Chopp Brahma</title><script language="JavaScript" type="text/JavaScript">	function CarregaDados(){	Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?fantasia='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}		function inicia(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("endereco").Value = local1[0][1];document.getElementById("uf").Value = local1[0][2];document.getElementById("cidade").Value = local1[0][3];document.getElementById("ddd1").Value = local1[0][4];document.getElementById("tel1").Value = local1[0][5];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][9];document.getElementById("contato").Value = local1[0][11];document.getElementById("email").Value = local1[0][12];document.getElementById("proprietario").Value = local1[0][13];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><center><div style="DISPLAY: none; POSITION: absolute" align="left"><IFRAME src name="myIframe" id="myIframe" width="400" height="100" marginwidth="0" marginheight="0"></IFRAME>  <form name="cad" method="post" action="index_valida.asp">	<table width="798" height="567" border="0" background="../fundo_cad.jpg">	  <tr>		<td width="768" height="563"><center>  <p><font color="#214B97" size="6" face="Arial, Helvetica, sans-serif">	Confirmação de dados </font><br>  </p>  <p> </p>  <p> </p>  <table width="284" border="0">	<tr>	  <td width="278" height="30"><table width="373" border="0">		<tr>		  <td width="182"><span class="texto10"><strong>Cod. do estabelecimento:</strong></span></td>		  <td width="181"><select name="codbar" onChange="carregar();">			  <option>...</option>			  <%While not rs.Eof%>			  <option value="<%=rs("codbar")%>"><%=rs("codbar")%></option>			  <%rs.MoveNext				Wend	%>			</select>		  </td>		</tr>		<tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		<tr>	<td width="181">UF</td>	<td width="181"><input name="uf" type="text" id="uf"></td>		</tr>		<tr>	<td width="181">cidade</td>	<td width="181"><input name="cidade" type="text" id="cidade"></td>		</tr>		<tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		<tr>	<td width="181">ddd1</td>	<td width="181"><input name="ddd1" type="text" id="ddd1"></td>		</tr>		<tr>	<td width="181">tel1</td>	<td width="181"><input name="tel1" type="text" id="tel1"></td>		</tr>		<tr>	<td width="181">ddd2</td>	<td width="181"><input name="ddd2" type="text" id="ddd2"></td>		</tr>		<tr>	<td width="181">tel2</td>	<td width="181"><input name="tel2" type="text" id="tel2"></td>		</tr>		<tr>	<td width="181">contato</td>	<td width="181"><input name="contato" type="text" id="contato"></td>		</tr>		<tr>	<td width="181">tel2</td>	<td width="181"><input name="tel2" type="text" id="tel2"></td>		</tr>		<tr>	<td width="181">email</td>	<td width="181"><input name="email" type="text" id="email"></td>		</tr>		<tr>	<td width="181">proprietario</td>	<td width="181"><input name="proprietario" type="text" id="proprietario"></td>		</tr>		</table></td>	</tr>  </table>  <table>			<tr>		<td><input name="Enviar" type="submit" id="Enviar" value="Próximo Passo"></td>			</tr>		</table></center></td>	  </tr>	</table>	<br>  </form></center></body></html><% If CInt(Request.QueryString("msg")) = 1 Then %><script language="javascript" type="text/javascript"><!-- alert("Cadastro efetuado com sucesso.");//--></script><% End If %><% If CInt(Request.QueryString("msg")) = 2 Then %><script language="javascript" type="text/javascript"><!-- alert("Login já cadastrado no sistema, favor escolher outro.");//--></script><% End If %>
e quando entro na tela não aparece nada só um fundo preto, que é a cor do meu body... ai mandei exibir o cod de fonte e vem assim:

<html><head><title>Chopp Brahma</title><script language="JavaScript" type="text/JavaScript"> function CarregaDados(){ Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT var url; url = 'remote.asp?fantasia='+Combo2[Combo2.selectedIndex].value; myIframe.location = url; Combo2.focus() } function inicia(){ local1 = new Array(); var maximo1, i; local1 = myIframe.loc; document.getElementById("endereco").Value = local1[0][1];document.getElementById("uf").Value = local1[0][2];document.getElementById("cidade").Value = local1[0][3];document.getElementById("ddd1").Value = local1[0][4];document.getElementById("tel1").Value = local1[0][5];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][9];document.getElementById("contato").Value = local1[0][11];document.getElementById("email").Value = local1[0][12];document.getElementById("proprietario").Value = local1[0][13];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><style type="text/css"><!--body{ background-color: #000000; } .texto10 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000100; } .texto11 { font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #1F4F99; } .texto11 { font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #464646; } .textocima { font-family:Arial, Helvetica, sans-serif; color: #214B97; font-size: 20px; } .observacima { font-family:Arial, Helvetica, sans-serif; color: #FF0000; font-size:12px; } .divhorizontal { color:#000000; width:700px; height:300px; overflow:scroll; } .texto8 { font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000100; } --> </style><center><div style="DISPLAY: none; POSITION: absolute" align="left"><IFRAME src name="myIframe" id="myIframe" width="400" height="100" marginwidth="0" marginheight="0"></IFRAME> <form name="cad" method="post" action="index_valida.asp"> <table width="798" height="567" border="0" background="../fundo_cad.jpg"> <tr> <td width="768" height="563"><center> <p><font color="#214B97" size="6" face="Arial, Helvetica, sans-serif"> Confirmação de dados </font><br> </p> <p> </p> <p> </p> <table width="284" border="0"> <tr> <td width="278" height="30"><table width="373" border="0"> <tr> <td width="182"><span class="texto10"><strong>Cod. do estabelecimento:</strong></span></td> <td width="181"><select name="codbar" onChange="carregar();"> <option>...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </td> </tr> <tr> <td width="181">Endereço</td> <td width="181"><input name="endereco" type="text" id="endereco"></td> </tr> <tr> <td width="181">UF</td> <td width="181"><input name="uf" type="text" id="uf"></td> </tr> <tr> <td width="181">cidade</td> <td width="181"><input name="cidade" type="text" id="cidade"></td> </tr> <tr> <td width="181">Endereço</td> <td width="181"><input name="endereco" type="text" id="endereco"></td> </tr> <tr> <td width="181">ddd1</td> <td width="181"><input name="ddd1" type="text" id="ddd1"></td> </tr> <tr> <td width="181">tel1</td> <td width="181"><input name="tel1" type="text" id="tel1"></td> </tr> <tr> <td width="181">ddd2</td> <td width="181"><input name="ddd2" type="text" id="ddd2"></td> </tr> <tr> <td width="181">tel2</td> <td width="181"><input name="tel2" type="text" id="tel2"></td> </tr> <tr> <td width="181">contato</td> <td width="181"><input name="contato" type="text" id="contato"></td> </tr> <tr> <td width="181">tel2</td> <td width="181"><input name="tel2" type="text" id="tel2"></td> </tr> <tr> <td width="181">email</td> <td width="181"><input name="email" type="text" id="email"></td> </tr> <tr> <td width="181">proprietario</td> <td width="181"><input name="proprietario" type="text" id="proprietario"></td> </tr> </table></td> </tr> </table> <table> <tr> <td><input name="Enviar" type="submit" id="Enviar" value="Próximo Passo"></td> </tr> </table></center></td> </tr> </table> <br> </form></center></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tem como disponibilizar um exemplinho Online para ver rolando?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tem sim Salgado, vou te mandar uma MP com a URL login e senha pra você ver beleza??abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,Te mandei uma MP com o login e senha do site.Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

Fiz a alteração e agora exibe a tela com todos os campos, mas não carrega o select...

Veja como esta meu script

 

<!--#include file="conexao.asp"--><%IF Not(Session("logado")) ThenResponse.Redirect "index.asp"Response.EndEnd IFSql = "Select * from cad_bares"Set rs = Conexcao.Execute(Sql)%><html><head><title>Chopp Brahma</title><script language="JavaScript" type="text/JavaScript">	function CarregaDados(){	Combo2 = document.Cadastro.fantasia; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?fantasia='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}		function inicia(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("endereco").Value = local1[0][1];document.getElementById("uf").Value = local1[0][2];document.getElementById("cidade").Value = local1[0][3];document.getElementById("ddd1").Value = local1[0][4];document.getElementById("tel1").Value = local1[0][5];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][9];document.getElementById("contato").Value = local1[0][11];document.getElementById("email").Value = local1[0][12];document.getElementById("proprietario").Value = local1[0][13];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><form name="cad" method="post" action="index_valida.asp">	<table width="798" height="567" border="0" background="../fundo_cad.jpg">	  <tr>		<td width="768" height="563"><center>  <p><font color="#214B97" size="6" face="Arial, Helvetica, sans-serif">	Confirmação de dados </font><br>  </p>  <p> </p>  <p> </p>  <table width="284" border="0">	<tr>	  <td width="278" height="30"><table width="373" border="0">		<tr>		  <td width="182"><span class="texto10"><strong>Cod. do estabelecimento:</strong></span></td>		  <td width="181"><div style="DISPLAY: none; POSITION: absolute" align="left"><IFRAME src name="myIframe" id="myIframe" width="400" height="100" marginwidth="0" marginheight="0"></IFRAME></div><select name="codbar" onChange="CarregaDados();">			  <option>...</option>			  <%While not rs.Eof%>			  <option value="<%=rs("codbar")%>"><%=rs("codbar")%></option>			  <%rs.MoveNext				Wend	%>			</select>		  </td>		</tr>		<tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		<tr>	<td width="181">UF</td>	<td width="181"><input name="uf" type="text" id="uf"></td>		</tr>		<tr>	<td width="181">cidade</td>	<td width="181"><input name="cidade" type="text" id="cidade"></td>		</tr>		<tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		<tr>	<td width="181">ddd1</td>	<td width="181"><input name="ddd1" type="text" id="ddd1"></td>		</tr>		<tr>	<td width="181">tel1</td>	<td width="181"><input name="tel1" type="text" id="tel1"></td>		</tr>		<tr>	<td width="181">ddd2</td>	<td width="181"><input name="ddd2" type="text" id="ddd2"></td>		</tr>		<tr>	<td width="181">tel2</td>	<td width="181"><input name="tel2" type="text" id="tel2"></td>		</tr>		<tr>	<td width="181">contato</td>	<td width="181"><input name="contato" type="text" id="contato"></td>		</tr>		<tr>	<td width="181">tel2</td>	<td width="181"><input name="tel2" type="text" id="tel2"></td>		</tr>		<tr>	<td width="181">email</td>	<td width="181"><input name="email" type="text" id="email"></td>		</tr>		<tr>	<td width="181">proprietario</td>	<td width="181"><input name="proprietario" type="text" id="proprietario"></td>		</tr>		</table></td>	</tr>  </table>  <table>			<tr>		<td><input name="Enviar" type="submit" id="Enviar" value="Próximo Passo"></td>			</tr>		</table></center></td>	  </tr>	</table>	<br>  </form></center></body></html><% If CInt(Request.QueryString("msg")) = 1 Then %><script language="javascript" type="text/javascript"><!-- alert("Cadastro efetuado com sucesso.");//--></script><% End If %><% If CInt(Request.QueryString("msg")) = 2 Then %><script language="javascript" type="text/javascript"><!-- alert("Login já cadastrado no sistema, favor escolher outro.");//--></script><% End If %>

Valeu!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pode ser o Iframe Salgado???Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você teria que ter 2 SELECTS naquele form?

Compartilhar este post


Link para o post
Compartilhar em outros sites

O outro select seria na UF e na cidade que ai puxaria do meu JS, mas se não der beleza, isso seria só para que uma pessoa não alterasse tipo São Paulo e o outro Sao paulo, mas se não der beleza!Abs

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.