It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes Display or not to display other controls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Display or not to display other controls" Watch "Display or not to display other controls" New topic
Author

Display or not to display other controls

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
I have some radio buttons for four different tasks,

1. Something here.
2. Something 2 here.
3. SOmething 3 here.
4. something 4 here.

On checking each one i must push some controls in-between dynamically, so that they can be added. Selection of first radio mush push-in two text-box and deselection(by selecting other radio buttons) must hide text-boxes back, selection of option 2 must push-in say a text-area and list box...

HOw do i render/generate/hide such dynamic controls???


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onclick="document.getElementById('divId').style.display=(this.checked)?'block':'none';"

<div id="idvId" style="display:none">foo</div>
[ December 14, 2006: Message edited by: Eric Pascarello ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Forgot to mention, you need to build a function to loop through the other controls and hide them. The code above is really meant for a checkbox.

Eric
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Thanks Eric. It worked for me here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display or not to display other controls