470,636 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Probleme mit Auswertung von Formulardaten

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
1 1976
"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.

Similar topics

1 post views Thread by Geiregat Jonas | last post: by
1 post views Thread by cyril | last post: by
reply views Thread by Jan Metzger | last post: by
2 posts views Thread by loki | last post: by
reply views Thread by fishomen | last post: by
2 posts views Thread by Winkl | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.