Visualizzazione dei risultati da 1 a 4 su 4

Discussione: opzione radio button

  1. #1

    opzione radio button

    Salve a tutti...
    Ho questo script realizzato gentilmente da un amico qui nel forum..
    qualcuno puo darmi una mano nel perfezionarlo!
    sembra tanto codice ma e solo una tabella
    Codice PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <
    html>

        <
    head>
            <
    meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
            <
    title></title>
            <
    script type="text/javascript" language="JavaScript1.2">
    function 
    resetta()
    {
    window.document.frmPreventivo.reset()
    document.frmPreventivo.elements['item[5]'][1].disabled false;
    }

    function 
    check()
    {
    var 
    opz1 document.frmPreventivo.elements['item[0]']
    var 
    opz2 document.frmPreventivo.elements['item[5]']
    if(
    opz1[2].checked && !opz2[0].checked && !opz2[1].checked){alert("ATTENZIONE\nSelezionare il supporto"); return false;}else
    if(
    opz1[3].checked && !opz2[0].checked && !opz2[1].checked){alert("ATTENZIONE\nSelezionare il supporto"); return false;}else
        if (!
    document.frmPreventivo.contratto.checked)
            {
    alert ("E' necessario autorizzare le condizioni contrattuali") ; return false}
        }
        function 
    ImpostaPiano(RadioValue){
        if(
    RadioValue == || RadioValue == 5){
        
    document.frmPreventivo.elements['item[5]'][0].checked true;
        
    document.frmPreventivo.elements['item[5]'][1].disabled true;
        }else{
        
    document.frmPreventivo.elements['item[5]'][0].checked false;
        
    document.frmPreventivo.elements['item[5]'][1].disabled false;
        }
    }
    </script>
        </head>

        <body bgcolor="#ffffff">
            <table cellspacing="1" cellpadding="0" width="435" border="0" height="337">
                <form name="frmPreventivo" action="configurato.asp" method="post">
                    <input type="hidden" value="1" name="frmAction"> <input type="hidden" value="<%=wdominio%>" name="Dominio"> <input type="hidden" value="<%=wext%>" name="ext"> <input type="hidden" value="<%=StrTipo_Operazione%>" name="tipo_operazione"><tbody>
                        <tr>
                            <td valign="top" width="433">
                                <div align="center">
                                    <table height="335" cellspacing="0" cellpadding="0" width="420" border="0" class="testo">
                                        <tbody>
                                            <tr height="167">
                                                <td valign="top" width="418" height="167">
                                                    <table cellspacing="2" cellpadding="2" width="422" border="0">
                                                        <tbody>
                                                            <tr height="13">
                                                                <td class="H1" colspan="3" bgcolor="#0d3f96" width="414" height="13">
                                                                    <div>
                                                                        [b]  Tipologia Servizio [/b]</div>
                                                                </td>
                                                            </tr>
                                                            <tr height="19">
                                                                <td class="H1" bgcolor="#5791c6" width="242" height="19"><input class="noinput" type="radio" value="1" name="item[0]"  onclick="ImpostaPiano(this.value)" checked > Solo dominio</td>
                                                                <td class="H1" bgcolor="#eeeeee" width="34" height="19"></td>
                                                                <td class="H5" valign="middle" bgcolor="#eeeeee" width="112" height="19">
                                                                    <div align="center">
                                                                        <font color="black"><%=wprezzo%> € / anno  </font></div>
                                                                    <div align="right">
                                                                        <font color="black"></font></div>
                                                                </td>
                                                            </tr>
                                                            <tr height="14">
                                                                <td class="H1" bgcolor="#5791c6" width="242" height="14"><input class="noinput" type="radio" value="2" name="item[0]" onclick="ImpostaPiano(this.value)"> Basic Plain</td>
                                                                <td class="H1" bgcolor="#eeeeee" width="34" height="14">[img]icon_linux.gif[/img]</td>
                                                                <td class="H5" valign="middle" bgcolor="#eeeeee" width="112" height="14">
                                                                    <div align="center">
                                                                        <font color="black">30,00 € / anno </font></div>
                                                                </td>
                                                            </tr>
                                                            <tr height="14">
                                                                <td class="H1" bgcolor="#5791c6" width="242" height="14"><input class="noinput" type="radio" value="3" name="item[0]" onclick="ImpostaPiano(this.value)"> Silver Plain</td>
                                                                <td class="H1" bgcolor="#eeeeee" width="34" height="14">[img]icon_linux.gif[/img][img]icon_win.gif[/img]</td>
                                                                <td class="H5" valign="middle" bgcolor="#eeeeee" width="112" height="14">
                                                                    <div align="center">
                                                                        <font color="black">50,00 € / anno </font></div>
                                                                </td>
                                                            </tr>
                                                            <tr height="14">
                                                                <td class="H1" bgcolor="#5791c6" width="242" height="14"><input class="noinput" type="radio" value="4" name="item[0]" onclick="ImpostaPiano(this.value)"> Golden Plain</td>
                                                                <td class="H1" bgcolor="#eeeeee" width="34" height="14">[img]icon_linux.gif[/img][img]icon_win.gif[/img]</td>
                                                                <td class="H5" valign="middle" bgcolor="#eeeeee" width="112" height="14">
                                                                    <div align="center">
                                                                        <font color="black">100,00 € / anno  </font></div>
                                                                </td>
                                                            </tr>
                                                            <tr height="14">
                                                                <td class="H1" bgcolor="#5791c6" width="242" height="14"><input class="noinput" type="radio" value="5" name="item[0]" onclick="ImpostaPiano(this.value)"> Hosting XXL</td>
                                                                <td class="H1" bgcolor="#eeeeee" width="34" height="14">[img]icon_linux.gif[/img]</td>
                                                                <td class="H5" valign="middle" bgcolor="#eeeeee" width="112" height="14">
                                                                    <div align="center">
                                                                        <font color="black">35,00 € / anno </font></div>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr height="73">
                                                <td valign="top" width="418" height="73">
                                                    <table cellspacing="2" cellpadding="2" width="422" border="0">
                                                        <tbody>
                                                            <tr height="13">
                                                                <td class="H1" colspan="2" bgcolor="#0d3f96" width="414" height="13">
                                                                    <div class="lista2p">
                                                                        [b]  Piattaforma[/b]</div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="H1" bgcolor="#5791c6" width="282"><input class="noinput" type="radio" value="2" name="item[5]"> Supporto  Linux</td>
                                                                <td valign="bottom" bgcolor="#eeeeee" width="126">
                                                                    <div align="center">
                                                                        [img]icon_linux.gif[/img]</div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="H1" bgcolor="#5791c6" width="282"><input class="noinput" type="radio" value="1" name="item[5]"> Supporto Windows</td>
                                                                <td valign="bottom" bgcolor="#eeeeee" width="126">
                                                                    <div align="center">
                                                                        [img]icon_win.gif[/img]</div>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr height="45">
                                                <td valign="top" width="418" height="45">
                                                    <table cellspacing="2" cellpadding="2" width="422" border="0">
                                                        <tbody>
                                                            <tr height="13">
                                                                <td class="H1" colspan="2" bgcolor="#0d3f96" width="414" height="13">
                                                                    <div class="lista2p">
                                                                        [b]  Servizi aggiuntivi[/b]</div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="H1" bgcolor="#5791c6" width="281"><input class="noinput" type="radio" value="1" name="item[3]"> BakeUp mensile</td>
                                                                <td class="H1" valign="bottom" bgcolor="#eeeeee" width="127">
                                                                    <div align="right">
                                                                        <font color="black">60,00 € / anno </font></div>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr height="20">
                                                <td valign="middle" width="418" height="20"><input type="checkbox" name="contratto" value="autorizzata">Condizioni contrattuali</td>
                                            </tr>
                                            <tr height="30">
                                                <td valign="middle" width="418" height="30">
                                                    <div align="center">
                                                        <input onclick="return check();" type="image" value=Invia name=B1 src="
    invia.gif" tabindex="10"> [url="#"][img]reset.gif[/img][/url]</div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </form>
            </table>
            

    </p>
        </body>

    </html> 
    Il mi scopo e di fare in modo che quando si apra la pagina o seleziono il check "solo dominio", le opzioni della piattaforma siano disattivate e non selezionabili!

    Ho provato a smanettare ma sono 5 giorni che non ci riesco
    Grazie a tutti
    :master:
    Scusate sto imparando!

  2. #2
    Salve..
    Smanettando un po nel codice, sono riuscito in parte a risolvere il problema, ma adesso le funzioni precedenti funzionano a metà
    secondo me non sono riuscito a concatenare bene questa funzione:
    function ImpostaPiano(RadioValue)
    posto il codice modificato...
    Codice PHP:
    <script type="text/javascript" language="JavaScript1.2">
    function 
    resetta2()
    {
    window.document.frmPreventivo.reset()
    document.frmPreventivo.elements['item[5]'][1].disabled false;

    }
    function 
    check()
    {
    var 
    opz1 document.frmPreventivo.elements['item[0]']
    var 
    opz2 document.frmPreventivo.elements['item[5]']
    if(
    opz1[2].checked && !opz2[0].checked && !opz2[1].checked){alert("ATTENZIONE\nSelezionare il supporto"); return false;}else
    if(
    opz1[3].checked && !opz2[0].checked && !opz2[1].checked){alert("ATTENZIONE\nSelezionare il supporto"); return false;}else
        if (!
    document.frmPreventivo.contratto.checked)
            {
    alert ("E' necessario autorizzare le condizioni contrattuali") ; return false}
        }
        function 
    ImpostaPiano(RadioValue){
        if(
    RadioValue == || RadioValue == 5){
        
    document.frmPreventivo.elements['item[5]'][0].checked true;
        
    document.frmPreventivo.elements['item[5]'][1].disabled true;
        }else{
        
    document.frmPreventivo.elements['item[5]'][0].checked false;
        
    document.frmPreventivo.elements['item[5]'][1].disabled false;
        }
        if(
    RadioValue == 1){
        
    document.frmPreventivo.elements['item[5]'][0].disabled true;
        
    document.frmPreventivo.elements['item[5]'][1].disabled true;
        }else{
        
    document.frmPreventivo.elements['item[5]'][0].disabled false;
        
    document.frmPreventivo.elements['item[5]'][1].disabled false;
        }

    praticamente adesso funziona solo da
    if(RadioValue == 1){
    la funzione
    if(RadioValue == 2 || RadioValue == 5){
    funziona a meta

    scusate il gioco di parole...

    Grazie a tutti
    Scusate sto imparando!

  3. #3
    nessuno puo darmi una mano!?
    Scusate sto imparando!

  4. #4
    nessuna idea su come agiustare questo script?
    Scusate sto imparando!

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.