F
Frobinrobin
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].checked = false;
I cannot even use ...
alert(document.form.enabled[Submenu1].value)
Obviously it is the way I am accessing the checkboxes - can these be
mutli-dimensional?
checkboxname[group_name][0], checkboxname[group_name][1]
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].checked = false;
I cannot even use ...
alert(document.form.enabled[Submenu1].value)
Obviously it is the way I am accessing the checkboxes - can these be
mutli-dimensional?
checkboxname[group_name][0], checkboxname[group_name][1]