Jump to content
Fórum Script Brasil
  • 0

onChange


Nelson Cruz
 Share

Question

Pessoal tenho uma informação em uma tela que precisa ser parametro de uma outra na mesma tela..

alguém poderia me ajudar a adptar um codigo a minha pagina.

o codigo que está funcionando é o seguinte.

[table]
                <tr class="rows">
                  <td>
                          <b>Oper. Venda:</b>&nbsp;&nbsp;&nbsp;
                        <select name="fLOperVend" style="width:380" onChange="ComplForm();">
                        <option value="">Selecione...</option>
                        <%
                        SQL = "SELECT tbList_Opers.login_oper, tbList_Opers.nome_oper, EMPREGADOS.IDSUPERV "&_
                              "FROM tbList_Opers WITH (nolock) "&_
                              "LEFT OUTER JOIN EMPREGADOS WITH (nolock) ON tbList_Opers.login_oper = EMPREGADOS.LOGIN "&_
                              "WHERE     (tbList_Opers.dtdemis IS NULL) "&_
                              "ORDER BY tbList_Opers.nome_oper"
                        'response.write sql
                        'response.end

                        registro.open SQL,conexao,0,1

                        If registro.EOF then
                            registro.close
                        Else
                            arrOper = registro.getrows()
                            CountOp = uBound(arrOper, 2)
                            registro.close

                            For i = 0 to CountOp
                            %>
                                <option value="<%=arrOper(0,i)%>"><%=arrOper(1,i)%></option>
                            <%
                            Next
                        End if
                        %>
                        </select>
                        <br>


                            <b>Super. Venda:</b>&nbsp;
                        <select name="fLSupVend" style="width:380" id="idCoord">
                        <option value="">Selecione...</option>
                        <%
                        SQL = "SELECT login_coord, nome_coord "&_
                              "FROM tbList_Coord with(nolock) "&_
                              "WHERE (dtdemis IS NULL) "&_
                              "ORDER BY nome_coord"
                        registro.open SQL,conexao,0,1

                        If registro.EOF then
                            registro.close
                        Else
                            arrCoord = registro.getrows()
                            CountCoord = uBound(arrCoord, 2)
                            registro.close

                            For i = 0 to CountCoord
                            %>
                                <option value="<%=arrCoord(0,i)%>"><%=arrCoord(1,i)%></option>
                            <%
                            Next
                        End if
                        %>
                        </select>
                  </td>
                </tr>
[/table]

<script language="JavaScript">
function ComplForm(){

    matr = SubmitSel.fLOperVend.value;
    SubmitSel.fLSupVend.value="";

    switch(matr){
    <%
    For i = 0 To CountOp
    %>
    case '<%=arrOper(0,i)%>':
    SubmitSel.fLSupVend.value="<%=arrOper(2,i)%>";
    break;
    <%
    Next
    %>
    }
}
</script>
preciso que ele funcione nessa página.
<tr bgcolor="#F5F8FF">
                        <td><img src="../Imagens/Blank.GIF" width="10" height="5"></td>
                        <td class="Arial9_CZE_B" align="right">Setor:&nbsp;</td>
                        <td colspan="4">
                        <select name="cboSetor" class="Arial9_CZE" onChange="ComplForm();">
                        <option value="">Selecione...</option>
                        <%
         varSQL="SELECT * FROM SISTB05_SETOR"
         Set rsC = Server.CreateObject("ADODB.Recordset")
         rsC.open varSQL,varConSIOUV,3,1
         If NOT rsC.EOF OR NOT rsC.BOF Then
            do while not rsC.eof

         %>

                          <option value="<%=rsC("COD_SETOR")%>"><%=rsC("SETOR")%></option>
         <%
               rsC.movenext
            loop
         end if
         rsC.close
         set rsC=nothing
            varSQL=""
            
         %>
                        </select>
                        </td>
                     </tr>
                     <tr bgcolor="#F5F8FF">
                        <td><img src="../Imagens/Blank.GIF" width="10" height="5"></td>
                        <td class="Arial9_CZE_B" align="right">Assunto:&nbsp;</td>
                        <td colspan="4"><select name="cboAssunto" id="Setor"class="Arial9_CZE" >
                            <option value="" selected>-escolha-</option>
         <%
         varSQL="SELECT * FROM SISTB06_ASSUNTO"
         Set rsC = Server.CreateObject("ADODB.Recordset")
         rsC.open varSQL,varConSIOUV,3,1
         If NOT rsC.EOF OR NOT rsC.BOF Then
            do while not rsC.eof
         %>

                          <option value="<%=rsC("COD_ASSUNTO")%>"><%=rsC("ASSUNTO")%></option>
         <%
               rsC.movenext
            loop
         end if
         rsC.close
         set rsC=nothing
            varSQL=""
            
         %>
                        </select></td>
                     </tr>

Onde o que for selicionado na cboSetor altere as opções de assunto.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.2k
    • Total Posts
      647.5k
×
×
  • Create New...