Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Help su checkbox

  1. #1

    Help su checkbox

    Ciao ragazzi mi serve una bella dritta in javascript.

    Allora:
    Ho un form con due checkbox...

    <Form method="" action="">
    <input type="checkbox" name="pippo" value="1">
    <input type="checkbox" name="pluto" value="1">
    <input type="submit" name="Invio">
    </Form>

    Vorrei che nel momento in cui spunto una delle due checkbox, l'altra si deve disabilitare e quindi nel submit non deve inviare nessun valore.

    Tutto qui

    Un grazie anticipatamente!


    Aikon

  2. #2
    Utente di HTML.it L'avatar di medorex
    Registrato dal
    Apr 2002
    Messaggi
    252

    cosi

    <html>
    <head>
    <title>check</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_changeProp(objName,x,theProp,theValue) { //v6.0
    var obj = MM_findObj(objName);
    if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
    eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
    }
    }
    //-->
    </script>
    </head>

    <body>
    <form>
    <input name="a" type="checkbox" onClick="MM_changeProp('b','','checked','0','INPUT/CHECKBOX')" value="1">
    <input name="b" type="checkbox" value="1" onClick="MM_changeProp('a','','checked','0','INPUT/CHECKBOX')">
    </form>
    </body>
    </html>
    Ma quando impareremo mai ??

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.