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

enable/disable dynamic form elements

P: n/a
Hi,
I have a form that has checkboxes and lists generated in php with the
names like this
<input name=chk<?$i$j?onClick="EnableLst(name of checkbox)">
<select name =lst<?$i$j?disabled>
in a loop that generates them
now I want to be able when I click on the checkbox, it automatically
enable the select which is disabled by default.
I want to use a function in javascript, that will receive the name of
checkbox in parameter and changes the state of the select element.
The trick is that I dont know how to retreive the checkbox name :(
Any suggestions ?
Thanks.

Sep 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
prisk wrote:
Hi,
I have a form that has checkboxes and lists generated in php with the
names like this
<input name=chk<?$i$j?onClick="EnableLst(name of checkbox)">
<select name =lst<?$i$j?disabled>
in a loop that generates them
now I want to be able when I click on the checkbox, it automatically
enable the select which is disabled by default.
I want to use a function in javascript, that will receive the name of
checkbox in parameter and changes the state of the select element.
The trick is that I dont know how to retreive the checkbox name :(
Any suggestions ?
Thanks.
Do you mean something like this?

<input name=chk<?$i$j?>
onClick="EnableLst('lst'+this.name.split('chk').jo in(''))">
Sep 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.