| Author |
dynamic disable and enable
|
Aravind JAI
Greenhorn
Joined: Feb 06, 2006
Posts: 18
|
|
|
I have 2 radio buttons and two drop downs. when selecting a radio button the select box in the same line should get enabled.Tell em a solution
|
 |
Liyaquat Ali
Ranch Hand
Joined: Nov 16, 2005
Posts: 156
|
|
Hi Arvind, Here is a link that might be useful, it shows how to enable and disable select box using javascript. http://www.mredkj.com/tutorials/tutorial001.html and this link is a great javascript resource:- http://www.devguru.com/technologies/javascript/home.asp Hope that helps, Ali
|
Excuse me while I kiss the sky (Jimi Hendrix)
|
 |
Christian Gross
Author
Ranch Hand
Joined: Feb 20, 2006
Posts: 85
|
|
The problem with disabled is if it is referenced in the HTML regardless of value the element will be disabled. The solution I used is as follows: function EnableDisable( toEnable, toDisable) { document.getElementById( toEnable).disabled = true; document.getElementById( toDisable).disabled = false; } or function EnableDisable( toEnable, toDisable) { document.getElementById( toEnable)[ 'disabled'] = true; document.getElementById( toDisable)[ 'disabled'] = false; } Either one is ok.
|
Author of Ajax Patterns and Best Practices
|
 |
Liyaquat Ali
Ranch Hand
Joined: Nov 16, 2005
Posts: 156
|
|
Yes that sound like a very good solution, heck it is the entire solution. Gr8 work!
|
 |
 |
|
|
subject: dynamic disable and enable
|
|
|