Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    select dipendenti con oracle

    Ciao a tutti, è possibile fare il select dipendente con oracle?

    codice:
    <select name="slcditta" id="slcditta" onchange="dennis(this[this.selectedIndex].value)"">
                <%
    While (NOT ditta.EOF)
    %>
                <option value="<%=(ditta.Fields.Item("ID_SOC_ESTERNA").Value)%>"><%=(ditta.Fields.Item("RAGIONE_SOCIALE").Value)%></option>
                <%
      ditta.MoveNext()
    Wend
    If (ditta.CursorType > 0) Then
      ditta.MoveFirst
    Else
      ditta.Requery
    End If
    %>
              </select></td>
              <td width="77"></td>
            </tr>
            <tr>
              <td class="style1">Personale:</td>
              <td colspan="2"><select name="select3" size="5" multiple="MULTIPLE">
                <%
    if request.Form("slcditta") <> "" then
    	While (NOT tecnici_est.EOF)
    	%>
                <option value="<%=(tecnici_est.Fields.Item("ID_TECNICO_EST").Value)%>"><%=(tecnici_est.Fields.Item("COGNOME").Value)%></option>
                <%
    	  tecnici_est.MoveNext()
    	Wend
    	If (tecnici_est.CursorType > 0) Then
    	  tecnici_est.MoveFirst
    	Else
    	  tecnici_est.Requery
    	End If
    end if
    %>
              </select>
    ho già provato a fare il select
    codice:
    <%
    Dim tecnici_est
    Dim tecnici_est_numRows
    
    Set tecnici_est = Server.CreateObject("ADODB.Recordset")
    tecnici_est.ActiveConnection = MM_siman_STRING
    if request.Form("slcditta") <> "" then
    	tecnici_est.Source = "SELECT * FROM SIMAN.TECNICI_SOC_ESTERNE where ID_SOC_ESTERNA = " & request.Form("slcditta")
    	tecnici_est.CursorType = 0
    	tecnici_est.CursorLocation = 2
    	tecnici_est.LockType = 1
    	tecnici_est.Open()
    	tecnici_est_numRows = 0
    end if
    %>
    ho provato a girare in questo forum sui select dipendenti, ma il problema è che dovrei scrivere ogni array, le società sono mille e i tecnici esterni sono di più.

    ho provato in questo modo simile:
    codice:
    arr0 = ["Torino", "Asti"]
    arr00 = ["Torino","Maglione","Massello","Bosconero","Bonzo"]
    
    var arrReg
    arrReg = [arr0, arr1, arr2]
    
    //	Function to handle dynamically altering the contents of the Reg List box
    function RegChange(newDisplay)
    {	var RegSelect, ProSelect, ComSelect, NumEntries, i
    	RegSelect = document.nav.Reg
    	ProSelect = document.nav.Pro
    	ComSelect = document.nav.Com
    
    	//	Azzero Province
    	for (i = ProSelect.length; i > 0; i--) { ProSelect.options[i-1] = null }
    
    	//	Aggiungi Commento
    	ProSelect.options[0] = new Option("-- Seleziona la Provincia --",-1)
    
    	//	If Reg is selected add its Province to the Province List box
    	if (newDisplay >= 0)
    	{	NumEntries = arrReg[newDisplay].length
    		for (i = 1; i <= NumEntries; i++) {	ProSelect.options[i] = new  Option((arrReg[newDisplay])[i-1],(i-1))	}
    	}
    	ProSelect.selectedIndex = 0
    	ProChange()
    }
    
    //	Function to handle dynamically altering the contents of the Pro List box
    function ProChange(newDisplay)
    {	var RegSelect, ProSelect, ComSelect, NumEntries, i
    	RegSelect = document.nav.Reg
    	ProSelect = document.nav.Pro
    	ComSelect = document.nav.Com
    
    	//	Delete all entries in the Com list box
    	for (i = ComSelect.length; i > 0; i--) { ComSelect.options[i-1] = null }
    
    	//	Add comment option to Com List box
    	ComSelect.options[0] = new Option("-- Seleziona il Comune --",-1)
    
    	//	If Pro is selected add its Numeri to the Numeri List box
    	if (newDisplay >= 0)
    	{	tempNumeri = eval("arr"+RegSelect[RegSelect.selectedIndex].value+newDisplay) 
    		NumEntries = tempNumeri.length
    		for (i = 1; i <= NumEntries; i++) { ComSelect.options[i] = new Option(tempNumeri[i-1],i-1) }
    	}
    	ComSelect.selectedIndex = 0
    }
    Visto che con gli array, vorrei che sia dinamica...
    Come si fa?? Mi fa un pò impazzire questo scripting
    Grazie
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Ma tu come le vuoi le select dipendenti? totalmente lato client (devi caricare tutti gli array occorrenti nella pagina) o solo lato server (devi inviare il form parzialmente compilato per popolare la seconda select) o con RemoteScripting/ajax/ahah (scarichi di volta in volta la lista che ti occorre senza ricaricare la pagina)?

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3
    Per esempio Primo select: nomi delle ditte, questi si trovano nel db oracle, appena selezionato una ditta e poi il secondo select tutti i tecnici di quella ditta selezionata che anche questi si trovano nel db oracle che ce il foreign del ID_Società_esterna di quella db della primo select......
    Grazie

    P.S.= forse RemoteScripting/ajax/ahah sarebbe più bella? che mi consigli tu?
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.