473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

enable/disable dynamic form elements

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
1 1919
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bob Bedford | last post by:
I've this code: function checkdate(FormSubmit){ alert(document.getElementById('Mois').value); if(eval(document.getElementById('Mois'))>0 && eval(document.getElementById('Annee'))>0){...
1
by: Shabam | last post by:
Is there a way to present a form to a user by default with all forms disabled, then when user clicks a link, the fields become enabled?
3
by: Bart Van der Donck | last post by:
Hello, I have a dynamic page of which I don't know how many forms will be on it, neither which and how many elements will be in each form. I use the following java script to disable all...
3
by: joe t. | last post by:
Here's what to look at: http://sawyer.thookerov.net/request/itrequest.php (script file: http://sawyer.thookerov.net/request/request.js The form works fine in Firefox. Clicking on certain...
2
by: Mel | last post by:
i want to diable all submit_buttons untill all my form elements are populated. how can i do that ? thanks
6
by: Ben | last post by:
Here's what I have se far: <script type="text/javascript"> other_text.disabled = true; function other_text() { other_text.disabled = (other_check.checked == false)? false : true; } </script>...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.