scriptwelt.org das JavaScript Archiv

Navigation
Startseite
Audio & Sound
Formulare
Cookies
Fenster & Frame
Grafik & Text
Navigation
Suche Scripts
Fun und Spiele
Buttons
Diverse
Tutorials

Kontakt
eine Mail an ScriptWelt.org
Webhosting
Tipps zur Providerwahl und zum Webspace

JavaScript in eine HTML Datei einbinden

Sind JavaScripts sicher?

Links zum Thema JavaSript

Impressum
impressum

Formulare JavaScript / alles auswählen

Mit diesem JavaScript lassen sich alle Buttons in einem Formular auswählen.
Autor: wsabstract.com

Box 1
Box 2
Box 3
alle auswählen
keine auswählen

in <head> einfügen


<script type="text/javascript">
//Check all radio/check buttons script- by Wsabstract.com
//Visit Website Abstraction (wsabstract.com) for script
//Credit must stay intact for use

function checkall(formname,checkname,thestate){
var el_collection=eval("document.forms."+formname+"."+checkname)
for (c=0;c<el_collection.length;c++)
el_collection[c].checked=thestate
}

</script>

in <body> einfügen

<form name="test">
<input type="checkbox" name="v1"> Box 1<br>
<input type="checkbox" name="v1"> Box 2<br>
<input type="checkbox" name="v1"> Box 3<br>
</form>

<!-- checkall(name of form, common name of checkbox group, true or false)-->

<a href="javascript:checkall('test','v1',true)">alle auswählen</a><br>
<a href="javascript:checkall('test','v1',false)">keine auswählen</a>