[PHP] Checkbox alternado con un Select

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • CcCamikaze
    Langosta espía
    • 28-04-2003
    • 45790

    #1

    [PHP] Checkbox alternado con un Select




    quiero que cuando checkeo el select se deshabilite... y cuando descheckeo se habilite el select con los paises y se deshabilite el checkbox..

    es javascript eso¿

    T_T

    tinchox?
  • acha
    Mega Egelito
    • 10-11-2004
    • 3902

    #2
    Aca tiene mi buen


    Código:
    <html>
    <head>
    <script type="text/javascript">
    function habilitaCombo()
    {
    // relojeo si ta checkeado 
    if(document.getElementById("check1").checked==true){
          document.getElementById("selectBox").disabled=true //deshabilito 
    }else{
            document.getElementById("selectBox").disabled=false //habilito
    }
    
    
    }
    </script>
    </head>
    <body>
    
    <form>
    <input type="checkbox" id="check1" onclick="habilitaCombo()" />
    
    <select name="selectBox" id="selectBox">
    <option value="21">argentinax</option>
    <option value="23">bolivia</option>
    <option value="21">katmandu</option>
    </select>
    
    </form>
    
    </body>
    </html>

    Comentario

    • MoaLaiSkirulais
      ^^(V)^^
      • 08-07-2003
      • 23268

      #3
      ponele el todo como opcion del select?????

      Comentario

      • CcCamikaze
        Langosta espía
        • 28-04-2003
        • 45790

        #4
        Originalmente publicado por acha
        Aca tiene mi buen


        Código:
        <html>
        <head>
        <script type="text/javascript">
        function habilitaCombo()
        {
        // relojeo si ta checkeado 
        if(document.getElementById("check1").checked==true){
              document.getElementById("selectBox").disabled=true //deshabilito 
        }else{
                document.getElementById("selectBox").disabled=false //habilito
        }
        
        
        }
        </script>
        </head>
        <body>
        
        <form>
        <input type="checkbox" id="check1" onclick="habilitaCombo()" />
        
        <select name="selectBox" id="selectBox">
        <option value="21">argentinax</option>
        <option value="23">bolivia</option>
        <option value="21">katmandu</option>
        </select>
        
        </form>
        
        </body>
        </html>








        Comentario

        Trabajando...