Version compl�te: jsB@nk » Form » Checkbox » Boîtes de contrôle
URL: https://www.javascriptbank.com/controlled-boxes.html
Cet JavaScript permet cases de vérifier et de décocher basée sur la sélection dans une autre case. Si la case est cochée TOUS, tous les autres choix sans contrôle. Si un autre choix est cochée, la case est décochée TOUS. Utiles lors de la construction search
formulaires, des sondages, et plus encore!
Version compl�te: jsB@nk » Form » Checkbox » Boîtes de contrôle
URL: https://www.javascriptbank.com/controlled-boxes.html
<SCRIPT LANGUAGE="JavaScript">// Scott Waichler<!-- Beginfunction checkChoice(field, i) {if (i == 0) { // "All" checkbox selected.if (field[0].checked == true) {for (i = 1; i < field.length; i++)field[i].checked = false; }}else { // A checkbox other than "Any" selected.if (field[i].checked == true) {field[0].checked = false; } }}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form name=pickform><table><tr><td><input type=checkbox name=classes value="*" onclick="checkChoice(document.pickform.classes, 0)" checked>All<br><input type=checkbox name=classes value="science" onclick="checkChoice(document.pickform.classes, 1)">Science<br><input type=checkbox name=classes value="math" onclick="checkChoice(document.pickform.classes, 2)">Math<br><input type=checkbox name=classes value="english" onclick="checkChoice(document.pickform.classes, 3)">English<br><input type=checkbox name=classes value="history" onclick="checkChoice(document.pickform.classes, 4)">Histroy<br><input type=checkbox name=classes value="other" onclick="checkChoice(document.pickform.classes, 5)">Other</td></tr></table></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->