aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes dynamic disable and enable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "dynamic disable and enable" Watch "dynamic disable and enable" New topic
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!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: dynamic disable and enable
 
Similar Threads
I am dense
I can't post any reply only start new post
WA #1.....word association
get value from radio button
javaranch radio