Ir para conteúdo
Fórum Script Brasil
  • 0

Dúvida!


Lucyan Peixoto

Pergunta

ESTOU TENTANDO COLOCAR OS DADOS NO FORM AO SELECIONAR UMA AGÊNCIA NO LISTBOX

<html>
<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Sala das Prefeituras</title>
</head>

<body bgcolor="#FFFFFF">
<form name = "teste" method="POST" action="form_visitaAg.html" >  
    
    Agências: <select size="1" name="agencias">

<%

SQL = "SELECT * FROM dados_agencia"
    Set conn = Server.CreateObject("ADODB.Connection")
    Set result = Server.CreateObject("ADODB.Recordset")
    conn.Open "DBQ=" & Server.MapPath( "agendamento_visita1" ) & "; Driver={Microsoft Access Driver (*.mdb)};"

    result.Open SQL, conn

    While Not result.EOF

        If Not result.EOF Then

           pega_ag = result.Fields("nome_agencia")
           Response.Write "<option value="&pega_ag&">"&pega_ag&"</option>"

        End If

    

    result.MoveNext
    Wend
%>


       </select></font></b></p>

    <br>

    <div id="botao" align="center">
        <input type="submit" name="submit" value="Consultar"></div></div></input>
    </div>

</form>
<% 
result.Close
conn.Close
%>
</body>

</html>
===========================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Visita Gerentes</title>
<style type="text/css">
td{font-family:Arial, Helvetica, sans-serif}
#botao_salvar{
position:absolute;
left:13px;
top:300px;
}
#botao_novo{
position:absolute;
left:100px;
top:300px;
}
#botao_sair{
position:absolute;
left:560px;
top:300px;
}
#tabela{
position:absolute;
top:100px;
left:200px;
}
#cabecalho{
position:absolute;
left:425px;
top:50px;
}
</style>


</head>


<body>

<%

Dim nome_ag
Dim cidade_ag
Dim endereco_ag
Dim telefone_ag
Dim bairro_ag
Dim ag

SQL = "SELECT * FROM dados_agencia;"
    Set conn = Server.CreateObject("ADODB.Connection")
    Set result = Server.CreateObject("ADODB.Recordset")
    conn.Open "DBQ=" & Server.MapPath( "agendamento_visita1" ) & "; Driver={Microsoft Access Driver (*.mdb)};"

    result.Open SQL, conn

    While Not result.EOF
        
        If Not result.EOF Then
        
        ag = result.Fields("nome_agencia")
        
        If ag = pega_ag Then    
        
        
        cidade_ag = result.Fields("cidade_agencia")
                    


        End If

        End If

    result.MoveNext
    Wend

%> 

<div id ="cabecalho">
<table>
<tr>
<td><a href="http://www.sr2645.al.caixa"><img src="../agendamento_visitas/caixaicone.jpg" / width="150"></a></td>
</tr>
</table> 
</div>
<div id="tabela">
<form action= "../agendamento_visitas/salva_visitaGerente.asp" method="post" name="agenda_visita" onsubmit="return valida(this);">
<table width="625" border="1" bordercolor="#0000FF" align="center">
  <tr>
    <td> <div align="center">Visita Gerentes </div></td>  
    </tr>
  <tr>
    <td bordercolor="#FFFFFF">&nbsp;&nbsp;Nome:     
      <label>
      <input name="textfield_nome" type="text" id="textfield_nome" size="50"/>
      &nbsp;Matr&iacute;cula:
      <input name="textfield_matricula" type="text" id="textfield_matricula" />
</label></td>
    </tr>
  <tr>
    <td  bordercolor="#FFFFFF">&nbsp;&nbsp;Ag&ecirc;ncia:
      <label>
      <input name="textfield_agencia" type="text" id="textfield_agencia" size="40" value="<%=cidade_ag%>"/>
      &nbsp;&nbsp;&nbsp;Cidade:
      <input name="textfield_cidade" type="text" id="textfield_cidade" size="28"/>
</label></td>
    </tr>
  <tr>
    <td width="615" height="26" bordercolor="#FFFFFF">&nbsp;&nbsp;Endere&ccedil;o:
      <label>
      <input name="textfield_endereco" type="text" id="textfield_endereco" size="50"/>
      &nbsp;&nbsp;&nbsp;&nbsp;Bairro:      
      <input name="textfield_bairro" type="text" id="textfield_bairro" size="17"/>
      </label></td>
    </tr>
  <tr>
    <td bordercolor="#FFFFFF">&nbsp;&nbsp;UF:
      <label>
      
      </label>
      <label>
      <input name="textfield_" type="text" id="textfield_uf" size="1" value="AL" disabled="disabled"/>
      </label>
      &nbsp;&nbsp;&nbsp;Contato:
      <label>
      <input name="textfield_contato" type="text" id="textfield_contato" size="30"/>
      </label>%

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...