Noob Problem, Changing Checkbox[dyn_name][i] State
- From: Frobinrobin <frobinrobin@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 16:15:04 -0000
Hi all,
I'm using the following checkbox naming convention the reason being
that when I POST the form, PHP read it as a multidimonsional array
fairly easily.
<input type="checkbox" name="enabled[parent_name][]">
so when I post the form I will see (from PHP):
[enabled] => Array
(
[BaseMenu] => Array
(
[0] => 2
)
[Menu1] => Array
(
[0] => 40
[1] => 41
[2] => 42
)
[SubMenu1] => Array
(
[0] => 22
[1] => 21
)
etc...etc.....
This is an excellent way for POST'ing to PHP, the problem I have is at
the Client Side... when I deselect a 'master' checkbox (i.e. Menu1) I
want the sub menu's to deselect (i.e. Submenu1)
This doesnt happen, I've got my onClick working to the point that I
can display the various passed arguments.
So when I click on Menu1 it will count the number of checkboxes for
SubMenu1 and display an alert dialog whilst incrementing on each loop
but this only outputs a string.
So why does the following not work?
document.form.enabled[Submenu1][i].checked = false;
I cannot even use ...
alert(document.form.enabled[Submenu1][i].value)
Obviously it is the way I am accessing the checkboxes - can these be
mutli-dimensional?
checkboxname[group_name][0], checkboxname[group_name][1]
.
- Follow-Ups:
- Re: Noob Problem, Changing Checkbox[dyn_name][i] State
- From: Lee
- Re: Noob Problem, Changing Checkbox[dyn_name][i] State
- From: David Dorward
- Re: Noob Problem, Changing Checkbox[dyn_name][i] State
- Prev by Date: Re: innerHTML for a table row problem
- Next by Date: Re: innerHTML for a table row problem
- Previous by thread: Advice: how best to create an image
- Next by thread: Re: Noob Problem, Changing Checkbox[dyn_name][i] State
- Index(es):
Relevant Pages
|