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

Como são via JS eu já não sei se conseguiria ajudar.

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu tenho como um cadastro de UF e cidades via banco de dados tb eu posso usa-lo se preferir!vou deixar no jeito pra usar ele então!Mas preciso da sua ajuda para fazer esse "combo master" ai! rsAbraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,Com o 2 select fiz um outro "remote.asp", mas o nome ta remote2.asp.Como devo proceder agora?Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ahhh, sim, agora caiu a ficha. Teremos que mudar o nome da 2ª função desse trecho. Você deverá ter as funções "antigas" para poder carregar o 2º SELECT e essas novas para carregar os dados. Não precisará de 2 Iframes não.

Compartilhar este post


Link para o post
Compartilhar em outros sites

hehehe ^_^/>

e como faço para fazer funfar

 

veja como está:

<!--#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 %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara, basicamente seria algo assim:

<!--#include file="conexao.asp"-->
<%
IF Not(Session("logado")) Then
Response.Redirect "index.asp"
Response.End
End IF

Sql = "Select * from cad_bares"
Set rs = Conexcao.Execute(Sql)
%>
<html>
<head><title>Chopp Brahma</title>
<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);	
}	
}

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 ListaDados(){	
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="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 %>

Mas tem que adaptar o que vem dos "Remote.asp"

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

beleza?

Cara mudei meu remote.asp, pois o user terá que informar o cod do estabelecimento ao inves do nome, ai mudei e ele esta funcionando quando testo separado remote.asp?codbar=1

da certinho, mas quando ele esta naquela pagina que você ta me ajudando da erro...

Veja como esta meu remote.asp

<%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 codbar="& Request.QueryString("codbar")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>
e aqui fiz algumas alterações para tentar adaptar.

<!--#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 carregar(){	Combo1 = document.Cadastro.codbar; //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?codbar='+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);	}	}function CarregaDados(){	Combo2 = document.Cadastro.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}		function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//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="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 %>
Ai antes não estava dando erro e não aparecia nada, agora pelo menos esta dando erro! rs

o erro é Objeto esperado.

 

Abraços

e Valeu

 

Lucas,

Vou dar uma olhada nas URls

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,Dá uma maozinha aqui, por favor!Não consiho fazer funfar!Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

No do remote.asp troque:

parent.inicia();
Por
   parent.ListaDados();

Logo abaixo de seu SELECT codBAR, acrescente o SELECT Fantasia:

<select name="fantasia" id="fantasia" onChange="CarregaDados();">
<option>...</option>
</select>

E qual erro deu?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

beleza?

Cara deu uns paus em algumas coisas e consegui arrumar, como o nome do formulario que estava errado, mas tem uma parte que ta dando "Objeto esperado" linha 11

ai no exibir cod de fonte na pagina a linha 11 é essa:

addItem(Combo2,"Aguarde...carregando","",false,Combo2.length)

 

meu remote.asp esta assim agora:

 

<%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 codbar="& Request.QueryString("codbar")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.ListaDados();  </script>

e meu form ta 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 carregar(){	Combo1 = document.Cadastro.codbar; //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?codbar='+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);	}	}function CarregaDados(){	Combo2 = document.Cadastro.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}		function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><form name="Cadastro" 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="carregar();">			  <option>...</option>			  <%While not rs.Eof%>			  <option value="<%=rs("codbar")%>"><%=rs("codbar")%></option>			  <%rs.MoveNext				Wend	%>			</select>		  </td>		</tr>		<tr>	<td width="181">Fantasia</td>	<td width="181"><select name="fantasia" id="fantasia" onChange="CarregaDados();"><option>...</option></select></td> <tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		</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 %>
Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Testando naquele endereço que me passou deu um erro de que o AddItem não está definido. Salvo engano ele é uma função que o Adriano lhe passou não? Se sim coloque ele no código.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

Inseri e ficou 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 carregar(){	Combo1 = document.Cadastro.codbar; //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?codbar='+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);	}	}function CarregaDados(){	Combo2 = document.Cadastro.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	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);	}	}		function addItem(obj,strText,strValue,blSel,intPos){	 	 var newOpt,i,ArTemp,selIndex;	 	 selIndex = (blSel)?intPos:obj.selectedIndex;	 	 newOpt = new Option(strText,strValue);	 	 Len = obj.options.length+1	 	 if (intPos > Len) return	 	 obj.options.length = Len	 	 if (intPos != Len) {	 		  ArTemp = new Array();	 		  for(i=intPos;i<obj.options.length-1;i++)	 			   ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);	 		  for(i=intPos+1;i<Len;i++)	 			   obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);	 	 }	 	 obj.options[intPos] = newOpt;	 	 if (selIndex > intPos)	 		  obj.selectedIndex = selIndex+1;	 	 else if (selIndex == intPos)	  		  obj.selectedIndex = intPos;	 }	 	function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><form name="Cadastro" 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="carregar();">			  <option>...</option>			  <%While not rs.Eof%>			  <option value="<%=rs("codbar")%>"><%=rs("codbar")%></option>			  <%rs.MoveNext				Wend	%>			</select>		  </td>		</tr>		<tr>	<td width="181">Fantasia</td>	<td width="181"><select name="fantasia" id="fantasia" onChange="CarregaDados();"><option>...</option></select></td> <tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		</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 no segundo select(fantasia), fica a mensagem de carregando e não carrega, testei no remote.asp e ta funfando lá, só aqui nesse arquivo que não tá http://forum.imasters.com.br/public/style_emoticons/default/ermm.gif/>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você agora tem 2 Remote.ASP correto? Altere nas funções Carregar e CarregaDados para o Remote correto.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Assim???

 

<script language="JavaScript" type="text/JavaScript">	function carregar(){	Combo1 = document.Cadastro.codbar; //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?codbar='+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);	}	}function addItem(obj,strText,strValue,blSel,intPos){	 	 var newOpt,i,ArTemp,selIndex;	 	 selIndex = (blSel)?intPos:obj.selectedIndex;	 	 newOpt = new Option(strText,strValue);	 	 Len = obj.options.length+1	 	 if (intPos > Len) return	 	 obj.options.length = Len	 	 if (intPos != Len) {	 		  ArTemp = new Array();	 		  for(i=intPos;i<obj.options.length-1;i++)	 			   ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);	 		  for(i=intPos+1;i<Len;i++)	 			   obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);	 	 }	 	 obj.options[intPos] = newOpt;	 	 if (selIndex > intPos)	 		  obj.selectedIndex = selIndex+1;	 	 else if (selIndex == intPos)	  		  obj.selectedIndex = intPos;	 }	 function CarregaDados(){	Combo2 = document.Cadastro.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	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);	}	}		function addItem(obj,strText,strValue,blSel,intPos){	 	 var newOpt,i,ArTemp,selIndex;	 	 selIndex = (blSel)?intPos:obj.selectedIndex;	 	 newOpt = new Option(strText,strValue);	 	 Len = obj.options.length+1	 	 if (intPos > Len) return	 	 obj.options.length = Len	 	 if (intPos != Len) {	 		  ArTemp = new Array();	 		  for(i=intPos;i<obj.options.length-1;i++)	 			   ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);	 		  for(i=intPos+1;i<Len;i++)	 			   obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);	 	 }	 	 obj.options[intPos] = newOpt;	 	 if (selIndex > intPos)	 		  obj.selectedIndex = selIndex+1;	 	 else if (selIndex == intPos)	  		  obj.selectedIndex = intPos;	 }	 	function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script>

Fica só a mensagem carregando... :unsure:/>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não, você agora tem Remote.asp e Remote2.asp, não tem?

O Remote é de um JS e o Remote2 é de outro, eu só não sei dizer quem é quem.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Salgado,

não estou entendendo...

O que tenho que alterar???

Veja como está tudo

 

Veja aqui esta meu remote.asp

 

<%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 codbar="& Request.QueryString("codbar")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.ListaDados();  </script>

aqui esta meu remote2.asp

<%set Conexcao = Server.CreateObject("ADODB.Connection")Conexcao.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MaPpath("..\banco\db_chopp_brahma.mdb")SQL = "SELECT Cidade from ufs WHERE Sigla ='"& Request.QueryString("Sigla") &"';"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(2) //troquei de 2 para 11, que será o seu número de campos				 for (j=0; j < 2; 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("Cidade"))%>";	loc[<%=j%>][1] = "<%=trim(rs("Cidade"))%>";	// 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>

aqui esta meu script do form

 

<!--#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 carregar(){	Combo1 = document.Cadastro.codbar; //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?codbar='+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);	}	}function addItem(obj,strText,strValue,blSel,intPos){	 	 var newOpt,i,ArTemp,selIndex;	 	 selIndex = (blSel)?intPos:obj.selectedIndex;	 	 newOpt = new Option(strText,strValue);	 	 Len = obj.options.length+1	 	 if (intPos > Len) return	 	 obj.options.length = Len	 	 if (intPos != Len) {	 		  ArTemp = new Array();	 		  for(i=intPos;i<obj.options.length-1;i++)	 			   ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);	 		  for(i=intPos+1;i<Len;i++)	 			   obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);	 	 }	 	 obj.options[intPos] = newOpt;	 	 if (selIndex > intPos)	 		  obj.selectedIndex = selIndex+1;	 	 else if (selIndex == intPos)	  		  obj.selectedIndex = intPos;	 }	 function CarregaDados(){	Combo2 = document.Cadastro.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	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);	}	}		function addItem(obj,strText,strValue,blSel,intPos){	 	 var newOpt,i,ArTemp,selIndex;	 	 selIndex = (blSel)?intPos:obj.selectedIndex;	 	 newOpt = new Option(strText,strValue);	 	 Len = obj.options.length+1	 	 if (intPos > Len) return	 	 obj.options.length = Len	 	 if (intPos != Len) {	 		  ArTemp = new Array();	 		  for(i=intPos;i<obj.options.length-1;i++)	 			   ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);	 		  for(i=intPos+1;i<Len;i++)	 			   obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);	 	 }	 	 obj.options[intPos] = newOpt;	 	 if (selIndex > intPos)	 		  obj.selectedIndex = selIndex+1;	 	 else if (selIndex == intPos)	  		  obj.selectedIndex = intPos;	 }	 	function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><form name="Cadastro" 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="carregar();">			  <option>...</option>			  <%While not rs.Eof%>			  <option value="<%=rs("codbar")%>"><%=rs("codbar")%></option>			  <%rs.MoveNext				Wend	%>			</select>		  </td>		</tr>		<tr>	<td width="181">Fantasia</td>	<td width="181"><select name="fantasia" id="fantasia" onChange="CarregaDados();"><option>...</option></select></td> <tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		</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 %>
Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu já me perdi tb!

Vamos recapitular. Seu form terá um Select (codbar) que ao ser alterado irá carregar outro Select (fantasia) que ao ser alterado carregará os dados do estabelecimento selecionado, é isso?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Na verdade seria assim, o form terá um select (codbar) que ao ser alterado caregará tudo, eu não entendi pq tenho que colocar um select no fantasia. :D/>

Compartilhar este post


Link para o post
Compartilhar em outros sites

E porque não falou antes? :assobiando:/> Isso vai entrar no orçamento final :rolleyes:/>

 

Acho que agora vai:

<!--#include file="conexao.asp"-->
<%
IF Not(Session("logado")) Then
Response.Redirect "index.asp"
Response.End
End IF

Sql = "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.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	
var url;	
url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	
myIframe.location = url;	
Combo2.focus()	
}	

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

document.getElementById("fantasia").Value = local1[0][1];
document.getElementById("endereco").Value = local1[0][2];
document.getElementById("uf").Value = local1[0][3];
document.getElementById("cidade").Value = local1[0][4];
document.getElementById("ddd1").Value = local1[0][5];
document.getElementById("tel1").Value = local1[0][6];
document.getElementById("ddd2").Value = local1[0][7];
document.getElementById("tel2").Value = local1[0][8];
document.getElementById("contato").Value = local1[0][9];
document.getElementById("email").Value = local1[0][10];
document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.
}
</script>
</head>
<body>
<!--#include File="../estilo.css"-->

<form name="Cadastro" 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">Fantasia</td>
<td width="181"><input name="fantasia" id="fantasia" type="text">
<option>...</option>
</select></td>
<tr>
<td width="181">Endereço</td>
<td width="181"><input name="endereco" type="text" id="endereco"></td>
	</tr>
	</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 o Remote.asp:

<%
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 codbar="& Request.QueryString("codbar")
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.ListaDados();

</script>

Compartilhar este post


Link para o post
Compartilhar em outros sites

hehehhehe

 

Não funfou http://forum.imasters.com.br/public/style_emoticons/default/cry.gif/>

 

Modifiquei uma linha 2 linhas que estavam a mais no fantasia tava os option eu tirei, e não funfa.

 

veja como esta:

<!--#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.codbar; //ALTERE AQUI PARA SEU FORM E 2º SELECT	var url;	url = 'remote.asp?codbar='+Combo2[Combo2.selectedIndex].value;	myIframe.location = url;	Combo2.focus()	}	function ListaDados(){	local1 = new Array();	var maximo1, i;	local1 = myIframe.loc;	document.getElementById("fantasia").Value = local1[0][1];document.getElementById("endereco").Value = local1[0][2];document.getElementById("uf").Value = local1[0][3];document.getElementById("cidade").Value = local1[0][4];document.getElementById("ddd1").Value = local1[0][5];document.getElementById("tel1").Value = local1[0][6];document.getElementById("ddd2").Value = local1[0][7];document.getElementById("tel2").Value = local1[0][8];document.getElementById("contato").Value = local1[0][9];document.getElementById("email").Value = local1[0][10];document.getElementById("proprietario").Value = local1[0][11];//Vai repetindo aqui substituindo o id e o valor do segundo colchetes e testa.}</script></head><body><!--#include File="../estilo.css"--><form name="Cadastro" 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">Fantasia</td>	<td width="181"><input name="fantasia" id="fantasia" type="text"></td><tr>	<td width="181">Endereço</td>	<td width="181"><input name="endereco" type="text" id="endereco"></td>		</tr>		</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 %>

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.