Ir para conteúdo

POWERED BY:

Arquivado

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

Nando Leads

selecionar item no combo box e pesquisar sem clicar no botão

Recommended Posts

ex:tenho uma tela de pesquisa, o usuario abre o combobox excolhe o item e clica em pesquisar.gostaria de um jeito de quando ele clicar no item a pesquisa ja sera feita, sem ele ter que clicar no botao pesquisar.vai meu code do combobox:<form name="form1" method="post" action="motorista_pesquisar_pronto.asp"> <table width="707" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><span class="style1">Nome: <label> <select name="txtPesquisa" id="txtPesquisa">. <option value=" "> </option> <%while not rsquery1.eof%> <option value="<% = rsquery1("Nome")%>"><%= rsquery1("Nome")%></option> <% rsquery1.movenext Wend %> </select> </label> </span> <input type="submit" name="Submit" value="Pesquisar"> </div></td> </tr> </table></form>

Compartilhar este post


Link para o post
Compartilhar em outros sites

java script:

 

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

 

o asp:

<select name="txtPesquisa" id="txtPesquisa" onChange="MM_jumpMenu('self',this,0)">.
<option value=" "> </option>
<%while not rsquery1.eof%>
<option value="Pagina.asp?NOME=<% = rsquery1("Nome")%>"><%= rsquery1("Nome")%></option>

<%
rsquery1.movenext
Wend
%>
</select>

depois você faz um select que puxe a querystring NOME

Compartilhar este post


Link para o post
Compartilhar em outros sites

usei seu codigo mas não deu serto...acho que ele ñ ta errado, acho q é minha pagina de pesquisa....vo posta ela ae pra você ver...<style type="text/css"><!--.style1 { font-family: Tahoma; font-weight: bold;}.style2 {font-family: Tahoma}.style7 {font-family: tahoma; font-size: 12; }.style8 {font-size: 12}.style10 {font-family: Tahoma; font-weight: bold; font-size: 12px; }.style11 {font-family: Tahoma; font-size: 18px; }.style12 { font-size: 12px; font-weight: bold;}.style13 {font-family: tahoma}body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;}--></style><script language="javascript">function MM_jumpMenu(targ,selObj,restore){ //v3.0eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if (restore) selObj.selectedIndex=0;}</script> <%Dim ConnSet Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("bd.mdb") varPesquisa = request("txtPesquisa")varStatus = "Admitido"If varPesquisa = "" Then set rsquery = conn.execute("select * from Motorista where Status = '" & varStatus & "'")%> <form name="form1" method="post" action="motorista_pesquisar_pronto.asp"> <table width="707" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><span class="style1">Nome: <label> <select name="txtPesquisa" id="txtPesquisa">. <option value=" "> </option> <%while not rsquery.eof%> <option value="<% = rsquery("Nome")%>"><%= rsquery("Nome")%></option> <% rsquery.movenext Wend %> </select> </label> </span> <input type="submit" name="Submit" value="Pesquisar"> </div></td> </tr> </table></form><% else set rsquery1 = conn.execute("select * from Motorista where Status = '" & varStatus & "'") %> <form name="form1" method="post" action="motorista_pesquisar_pronto.asp"> <table width="707" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><span class="style1">Nome: <label> <select name="txtPesquisa" id="txtPesquisa" onChange="MM_jumpMenu('self',this,0)">. <option value=" "> </option> <%while not rsquery1.eof%> <option value="motorista_pesquisar_pronto.asp?NOME=<% = rsquery1("Nome")%>"><%= rsquery1("Nome")%></option> <% rsquery1.movenext Wend %> </select> </label> </span> <input type="submit" name="Submit" value="Pesquisar"> </div></td> </tr> </table></form> <p> <% set rsquery = conn.execute("select * from Motorista where Nome = '" & varPesquisa & "'") while not rsquery.eof%></p> <table width="200" border="2" align="center"> <tr> <td align="center">Motorista Admitido </td> </tr> </table> <table width="928" align="center"> <tr> <td width="168" rowspan="10" valign="top"><span class="style2"><img src="http://192.9.205.9/<%response.write(rsquery("Foto"))%>" width="148" height="181"></span></td> <td width="87" height="31" align="left"><div align="right" class="style12"><span class="style13">Nome:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Nome"))%> <span class="style8"></span></td> <td width="122" align="left"><div align="right" class="style12"><span class="style13">Apelido:</span></div></td> <td width="257" align="left"><span class="style7"> <%response.write(rsquery("Apelido"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">DT. Nasc: </span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("DataNascimento"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13"> Registro: </span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("Registro"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">RG:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("RG"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">CPF:</span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("CPF"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">Endereço:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Endereco"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Bairro</span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("Bairro"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">Cidade:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Cidade"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">CEP:</span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("CEP"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">Fone:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Fone"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Celular:</span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("Celular"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">Nextel:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Nextel"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Cel. Nextel: </span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("CelNextel"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12">CNH:</div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("CNH"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Val. CNH: </span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("ValidadeCNH"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">Ex. Medico: </span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("Exame"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Val. Exame: </span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("ValidadeExame"))%> </span></td> </tr> <tr> <td height="31" align="left"><div align="right" class="style12"><span class="style13">CFC:</span></div></td> <td colspan="2" align="left" valign="middle"><span class="style7"> <%response.write(rsquery("CFC"))%> </span><span class="style8"></span></td> <td align="left"><div align="right" class="style12"><span class="style13">Val. CFC </span></div></td> <td align="left"><span class="style7"> <%response.write(rsquery("ValidadeCFC"))%> </span></td> </tr></table><table width="707" height="11%" border="0" align="center"> <tr> <td width="195" height="16" align="center"><span class="style10">Comprovante de Endereço </span></td> <td width="242" align="center"><span class="style10">CNH</span></td> <td width="193" align="center"><span class="style10">CFC</span></td> </tr> <tr> <td height="68%" align="center"><span class="style2"><a href="http://localhost/<%response.write(rsquery("Foto1"))%>"><img src="http://192.9.205.9/<%response.write(rsquery("Foto1"))%>" width="48" height="62" border="0"></a></span></td> <td align="center"><span class="style2"><a href="http://localhost/<%response.write(rsquery("Foto2"))%>"><img src="http://192.9.205.9/<%response.write(rsquery("Foto2"))%>" width="48" height="62" border="0"></a></span></td> <td align="center"><span class="style2"><a href="http://localhost/<%response.write(rsquery("Foto3"))%>"><img src="http://192.9.205.9/<%response.write(rsquery("Foto3"))%>" width="48" height="62" border="0"></a></span></td> </tr> <tr> <td height="16" align="center"><p> </p> <p> </p> <p> </p></td> <td align="center"><a href="motorista.asp"></a><a href="Inicio.asp">Inicio</a></td> <td align="center"> </td> </tr></table><p><a href="#"></a> </p> <%rsquery.movenextWend End IfConn.Close%>

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.