Visualizzazione dei risultati da 1 a 8 su 8
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    function

    ciao a tutti,

    devo passare dei valori ad una funzione, questi valori arrivano da un'latra funzione come posso fare

    codice:
    <html>
    <head>
    <title>combo box</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script>
    function displayInfoSistema() { 
    
    	var sistema_value = document.getElementById("sistema").value;
    	var sistema_label = document.getElementById("sistema");
    	var testo = sistema_label.options[sistema_label.selectedIndex].text; 
    	var textsistema = document.getElementById("textsistema");
    	
    	if(sistema_value != 00){
    		textsistema.value = sistema_value;
    		test_popup.value = testo;
    		
    		alert(testo);
    		
    		/// come scrivo adesso per richiamare questa funzione?
    		javascript:popImage('../public/img/testo.jpg','VISUALIZZA');
    	}
    	
    }
    </script>
    </head>
    
    <body>
    <table width="100%"  cellspacing="0" cellpadding="0">
    	<tr>
    			<td>
    			<select name="sistema" id="sistema" onChange="displayInfoSistema()">
    				<option value="00"></option>
    				<option value="01">PRIMO</option>
    				<option value="02">SECONDO</option>
    				<option value="03">TERZO</option>
    				<option value="04">QUARTO</option>
    				<option value="05">QUINTO</option>
    				<option value="06">SESTO</option>
    				<option value="07">SETTIMO</option>
    			</select>
    			[img]../images/img/page.gif[/img]
    			</td>
    	</tr>
    	<tr>
    		<td>
    		<input name="textsistema" type="text" id="textsistema">
    		<input name="test_popup" type="text" id="test_popup">
    		</td>
    	</tr>
    </table>
    </body>
    </html>
    grazie :master:

  2. #2

    Re: function

    ma dovrebbe bastare chiamare la prima funzione
    elaborare
    e chiamare la seconda funzione passando i valori ottenuti
    prude il dito, lui sdraiato
    ha giocato a guardie e ladri col ladro sbagliato

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    guarda adesso sto facendo cosi
    codice:
    <html>
    <head>
    <title>combo box</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script>
    function displayInfoSistema() { 
    
    	var sistema_value = document.getElementById("sistema").value;
    	var sistema_label = document.getElementById("sistema");
    	var testo = sistema_label.options[sistema_label.selectedIndex].text; 
    	var textsistema = document.getElementById("textsistema");
    	
    	if(sistema_value != 00){
    		textsistema.value = sistema_value;
    		test_popup.value = testo;
    		document.write("<a href=\"javascript:popImage('../public/img/01.jpg','VISUALIZZA');\"><img src=\"../images/img/page.gif\" alt=\"VISUALIZZA\" width=\"18\" height=\"18\" border=\"0\"></a>");
    		alert(testo);
    	}
    	
    }
    </script>
    </head>
    
    <body>
    <table width="100%"  cellspacing="0" cellpadding="0">
    	<tr>
    			<td>
    			<select name="sistema" id="sistema" onChange="displayInfoSistema()">
    				<option value="00"></option>
    				<option value="01">PRIMO</option>
    				<option value="02">SECONDO</option>
    				<option value="03">TERZO</option>
    				<option value="04">QUARTO</option>
    				<option value="05">QUINTO</option>
    				<option value="06">SESTO</option>
    				<option value="07">SETTIMO</option>
    			</select>
    			</td>
    	</tr>
    	<tr>
    		<td>
    		<input name="textsistema" type="text" id="textsistema">
    		<input name="test_popup" type="text" id="test_popup">
    		</td>
    	</tr>
    </table>
    </body>
    </html>
    ma mi crea una pagina bianca con solo il tasto mentre io vorrei aggiungere alla pagina il tasto....


  4. #4
    cosa hai bisogno di fare ?
    prude il dito, lui sdraiato
    ha giocato a guardie e ladri col ladro sbagliato

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    devo eseguire la funzione e se
    codice:
    if(sistema_value != 00)
    allora stampo affianco alla select
    codice:
    document.write("<a href=\"java-script:popImage('../public/img/01.jpg','VISUALIZZA');\"><img src=\"../images/img/page.gif\" alt=\"VISUALIZZA\" width=\"18\" height=\"18\" border=\"0\"></a>");

    :master:

  6. #6
    Originariamente inviato da Rossella_75
    devo eseguire la funzione e se
    codice:
    if(sistema_value != 00)
    allora stampo affianco alla select
    codice:
    document.write("<a href=\"java-script:popImage('../public/img/01.jpg','VISUALIZZA');\"><img src=\"../images/img/page.gif\" alt=\"VISUALIZZA\" width=\"18\" height=\"18\" border=\"0\"></a>");

    :master:
    metti una cella vuota (<td id='cella_edit'></td>) vicino alla select

    e se (if(sistema_value != 00))
    codice:
    var obj = document.getElementById("cella_edit");
    obj.innerHTML = "<a href=\"java-script ....."
    prude il dito, lui sdraiato
    ha giocato a guardie e ladri col ladro sbagliato

  7. #7
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    scusa se rispondo solo adesso
    mi dà errore
    codice:
    <html>
    <head>
    <title>combo box</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script>
    function displayInfoSistema() { 
    
    	var sistema_value = document.getElementById("sistema").value;
    	var sistema_label = document.getElementById("sistema");
    	var testo = sistema_label.options[sistema_label.selectedIndex].text; 
    	var textsistema = document.getElementById("textsistema");
    	
    	if(sistema_value != 00){
    		textsistema.value = sistema_value;
    		var obj = document.getElementById("cella_edit");
    		obj.innerHTML = "<a href=\"javascript:popImage('../public/img/01.jpg','VISUALIZZA');\"><img src=\"../images/img/page.gif\" alt=\"VISUALIZZA\" width=\"18\" height=\"18\" border=\"0\"></a>";
    		alert(testo);
    	}
    	
    }
    </script>
    </head>
    
    <body>
    <table width="100%"  cellspacing="0" cellpadding="0">
    	<tr>
    			<td>
    			<select name="sistema" id="sistema" onChange="displayInfoSistema()">
    				<option value="00"></option>
    				<option value="01">PRIMO</option>
    				<option value="02">SECONDO</option>
    				<option value="03">TERZO</option>
    				<option value="04">QUARTO</option>
    				<option value="05">QUINTO</option>
    				<option value="06">SESTO</option>
    				<option value="07">SETTIMO</option>
    			</select>
    			</td>
    			<td id='cella_edit'></td> 
    	</tr>
    	<tr>
    		<td>
    		<input name="textsistema" type="text" id="textsistema">
    		</td>
    	</tr>
    </table>
    </body>
    </html>
    :master:

  8. #8
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    perdonami e perfetto cosi!!

    grazie

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 © 2025 vBulletin Solutions, Inc. All rights reserved.