firepages
06-28-2012, 01:12 AM
I don't even know how to ask/title the question :(
I have a whole load of date and time form fields generated auto from php, php creates them and auto-selects them etc.
they are all preceded by a checkbox so
<input type="checkbox" name="_e_monthly[1]' id="_e_monthly[1]" value="1">
<select id="_e_monthly_md_1">...all the options</select>
<select id="_e_monthly_ts_1">...all the options</select>
<select id="_e_monthly_tf_1">...all the options</select>
...
<input type="checkbox" name="_e_monthly[2]' id="_e_monthly[2]" value="1">
<select id="_e_monthly_md_2">...all the options</select>
<select id="_e_monthly_ts_2">...all the options</select>
<select id="_e_monthly_tf_2">...all the options</select>
now I can add onchange="blah()" to all of these checkboxes, (basically this wil disable the selects unless the checkbox is active)
but the HTML output is already massive, there are 12 months with day of month and start and finish times AND another set with weekly start and finish times.
so basically I want javascript that says .. look for all e_monthly[] checkboxes , get the [id] and apply onchange=blah(id) to all found, from that the rest I can manage ? any help appreciated
I have a whole load of date and time form fields generated auto from php, php creates them and auto-selects them etc.
they are all preceded by a checkbox so
<input type="checkbox" name="_e_monthly[1]' id="_e_monthly[1]" value="1">
<select id="_e_monthly_md_1">...all the options</select>
<select id="_e_monthly_ts_1">...all the options</select>
<select id="_e_monthly_tf_1">...all the options</select>
...
<input type="checkbox" name="_e_monthly[2]' id="_e_monthly[2]" value="1">
<select id="_e_monthly_md_2">...all the options</select>
<select id="_e_monthly_ts_2">...all the options</select>
<select id="_e_monthly_tf_2">...all the options</select>
now I can add onchange="blah()" to all of these checkboxes, (basically this wil disable the selects unless the checkbox is active)
but the HTML output is already massive, there are 12 months with day of month and start and finish times AND another set with weekly start and finish times.
so basically I want javascript that says .. look for all e_monthly[] checkboxes , get the [id] and apply onchange=blah(id) to all found, from that the rest I can manage ? any help appreciated