Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 16 su 16
  1. #11
    Utente di HTML.it
    Registrato dal
    Jan 2003
    Messaggi
    1,093
    ho provato a modificare lo script sopra, ma non funziona...qualcuno mi sa dire dove sbaglio...a me sembra corretto...



    <form name='tipo_form'>
    <input type="checkbox" name='registrati' onclick="mostra()">Registrazione al sito

    <input type="checkbox" name='informazioni' onclick="mostra()">Richiesta informazioni

    </form>
    <script>
    function mostra() {

    if (document.tipo_form.registrati.checked) {
    document.getElementById('registrati').style.visibi lity = "visible";
    document.getElementById('informazioni').style.visi bility = "hidden";
    }
    else {
    document.getElementById('registrati').style.visibi lity = "hidden";
    }


    if (document.tipo_form.informazioni.checked) {
    document.getElementById('informazioni').style.visi bility = "visible";
    document.getElementById('registrati').style.visibi lity = "hidden";
    }
    else {
    document.getElementById('informazioni').style.visi bility = "hidden";
    }
    }
    </script>

    <div id="registrati">
    <form name="registrati">
    <table width="30%">
    <tr>
    <td colspan="2">Registrati al sito</td>
    </tr>
    <tr>
    <td>Nome:</td>
    <td><input type="textbox" name="Nome"></td>
    </tr>
    <tr>
    <td>Cognome</td>
    <td><input type="textbox" name="cognome"></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="textbox" name="email"></td>
    </tr>
    <tr>
    <td>Telefono:</td>
    <td><input type="textbox" name="telefono"></td>
    </tr>
    <tr>
    <td>Città:</td>
    <td><input type="textbox" name="città"></td>
    </tr>
    <tr>
    <td><input type="submit" value="Registrati"></td>
    <td></td>
    </tr>
    </table>
    </form>
    </div>



    <div id="informazioni">
    <form name="informazioni">
    <table width="30%">
    <tr>
    <td colspan="2">Richiesta informazioni</td>
    </tr>
    <tr>
    <td>Nome:</td>
    <td><input type="textbox" name="Nome"></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="textbox" name="email"></td>
    </tr>
    <tr>
    <td>Richiesta</td>
    <td><textarea name="richiesta" cols="20" rows="10"></textarea></td>
    </tr>
    <tr>
    <td><input type="submit" value="Registrati"></td>
    <td></td>
    </tr>
    </table>
    </form>
    </div>



    granzie in anticipo..

  2. #12
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,373
    Cosi dovrebbe andare meglio. Occhio a non dare lo stesso nome o id a diversi elementi !!!!

    codice:
    <form name='tipo_form'> 
    <input type="checkbox" checked name='cb_registrati' onclick="mostraReg()">Registrazione al sito
     
    <input type="checkbox" checked name='cb_informazioni' onclick="mostraInf()">Richiesta informazioni
     
    </form> 
    <script> 
    function mostraReg() { 
    
    if (document.tipo_form.cb_registrati.checked) { 
    document.getElementById('div_registrati').style.visibility = "visible"; 
    } 
    else { 
    document.getElementById('div_registrati').style.visibility = "hidden"; 
    } 
    }
    
    function mostraInf() {
    
    if (document.tipo_form.cb_informazioni.checked) { 
    document.getElementById('div_informazioni').style.visibility = "visible"; 
    } 
    else { 
    document.getElementById('div_informazioni').style.visibility = "hidden"; 
    } 
    } 
    </script> 
    
    <div id="div_registrati"> 
    <form name="registrati"> 
    <table width="30%"> 
    <tr> 
    <td colspan="2">Registrati al sito</td> 
    </tr> 
    <tr> 
    <td>Nome:</td> 
    <td><input type="textbox" name="Nome"></td> 
    </tr> 
    <tr> 
    <td>Cognome</td> 
    <td><input type="textbox" name="cognome"></td> 
    </tr> 
    <tr> 
    <td>Email:</td> 
    <td><input type="textbox" name="email"></td> 
    </tr> 
    <tr> 
    <td>Telefono:</td> 
    <td><input type="textbox" name="telefono"></td> 
    </tr> 
    <tr> 
    <td>Città:</td> 
    <td><input type="textbox" name="città"></td> 
    </tr> 
    <tr> 
    <td><input type="submit" value="Registrati"></td> 
    <td></td> 
    </tr> 
    </table> 
    </form> 
    </div> 
    
    
    
    <div id="div_informazioni"> 
    <form name="informazioni"> 
    <table width="30%"> 
    <tr> 
    <td colspan="2">Richiesta informazioni</td> 
    </tr> 
    <tr> 
    <td>Nome:</td> 
    <td><input type="textbox" name="Nome"></td> 
    </tr> 
    <tr> 
    <td>Email:</td> 
    <td><input type="textbox" name="email"></td> 
    </tr> 
    <tr> 
    <td>Richiesta</td> 
    <td><textarea name="richiesta" cols="20" rows="10"></textarea></td> 
    </tr> 
    <tr> 
    <td><input type="submit" value="Registrati"></td> 
    <td></td> 
    </tr> 
    </table> 
    </form> 
    </div>
    Ridatemi i miei 1000 posts persi !!!!
    Non serve a nulla ottimizzare qualcosa che non funziona.
    Cerco il manuale dell'Olivetti LOGOS 80B - www.emmella.fr

  3. #13
    Utente di HTML.it
    Registrato dal
    Jan 2003
    Messaggi
    1,093
    azz...grazie mille...

  4. #14
    Utente di HTML.it
    Registrato dal
    Jan 2003
    Messaggi
    1,093
    sono sempre su questo script..e se volessi fare in modo che le form siano posizionate tutte nello stesso spazio di pagina?

    Adesso succede che la seconda form, se visibile, non prende il posto della prima...

    grazie

  5. #15
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,373
    Cosi

    codice:
    <script> 
    function mostraReg() { 
    
    if (document.tipo_form.cb_registrati.checked) { 
    document.getElementById('div_registrati').style.display = "block"; 
    } 
    else { 
    document.getElementById('div_registrati').style.display = "none"; 
    } 
    }
    
    function mostraInf() {
    
    if (document.tipo_form.cb_informazioni.checked) { 
    document.getElementById('div_informazioni').style.display = "block"; 
    } 
    else { 
    document.getElementById('div_informazioni').style.display = "none"; 
    } 
    } 
    </script>
    Ridatemi i miei 1000 posts persi !!!!
    Non serve a nulla ottimizzare qualcosa che non funziona.
    Cerco il manuale dell'Olivetti LOGOS 80B - www.emmella.fr

  6. #16
    Utente di HTML.it
    Registrato dal
    Jan 2003
    Messaggi
    1,093
    Ma sei enormeee!!...Grazie mille

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.