By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,728 Members | 1,411 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,728 IT Pros & Developers. It's quick & easy.

Probleme mit Auswertung von Formulardaten

P: n/a
Zor
Hallo,

ich habe folgendes Formular...

<form method="post" action="nix.php" name="formular">
<input type="checkbox" value="aaa" name="formData[kategorie][0]"> aaa
<input type="checkbox" value="bbb" name="formData[kategorie][1]"> bbb
<input type="checkbox" value="ccc" name="formData[kategorie][2]"> ccc
.....
<input type="checkbox" value="zzz" name="formData[kategorie][n]"> zzz

<input type="checkbox" value="1" name="alle"> alle auswählen
</form>

Wenn ich nun die Checkbox "alle" anklicke sollen alle Checkboxen die
darüber stehen selektiert werden. Das Problem: auf den letzten button
kann ich mit document.formular.alle.checked den Status der Checkbox
setzen und auslesen. Aber wenn ich
document.formular.formData[kategorie][0].checked probiere, sagt
Javascript, das kategorie kein Objekt ist...

Bitte helft mir mal

Danke im Vorraus
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Zor" <se***************@t-online.de> wrote in message
news:ab**************************@posting.google.c om...
ich habe folgendes Formular...

<form method="post" action="nix.php" name="formular">
<input type="checkbox" value="aaa" name="formData[kategorie][0]"> aaa
<input type="checkbox" value="bbb" name="formData[kategorie][1]"> bbb
<input type="checkbox" value="ccc" name="formData[kategorie][2]"> ccc
....
<input type="checkbox" value="zzz" name="formData[kategorie][n]"> zzz

<input type="checkbox" value="1" name="alle"> alle auswählen
</form>
<snip>document.formular.formData[kategorie][0].checked probiere, sagt

<snip>

I cannot read a word of German (?), but it looks like:-

document.formular['formData[kategorie][0]'].checked

or

document.forms['formular'].elements['formData[kategorie][0]'].checked

<URL: http://www.jibbering.com/faq/#FAQ4_25>

and

<URL: http://www.jibbering.com/faq/#FAQ4_39 >

....
var els = document.forms['formular'].elements;

for(var c = 0;c <= n;c++){
if(els[('formData[kategorie]['+c+']')].checked ){
...
}
}

Richard.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.