473,756 Members | 7,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Enable Lst(name of checkbox)">
<select name =lst<?$i$j?disa bled>
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 1937
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="Enable Lst(name of checkbox)">
<select name =lst<?$i$j?disa bled>
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="Enable Lst('lst'+this. name.split('chk ').join(''))">
Sep 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9207
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){ document.forms.getElementByID('SELECTCONSTRUCTOR').disabled = false; //can't reach the control here } else
1
1729
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
7186
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 elements from all forms: var numberForms = document.forms.length; var formIndex;
3
2308
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 elements enables or disables other elements as intended. The visual refreshes and sends focus as needed. However, using IE6, the visual does not refresh unless the user clicks away from the control element (eg. open area of page, or clicking one
2
4944
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
13138
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> <input type="checkbox" id="other_check" name="other_check"
1
4254
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 is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
3
3799
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) and they were put onto the form in the numerical sequence. I have given the A's with B & C's on the same line a tag=1; B.tag=2, C,tag=2) I am trying to write 2 modules so that the following occurs (on Form_Current and 'A' Control_Before or...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10040
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.