This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Display div's based upon selection of radio Buttons. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Display div Watch "Display div New topic
Author

Display div's based upon selection of radio Buttons.

Gopi Chand Maddula
Ranch Hand

Joined: May 11, 2010
Posts: 40

Hi,

I am a newbie in Javascript. I have a requirement of displaying different div's based upon which radio button is selected.

I should forward messages in two ways. either by sms or by mail.
So i have two div's one for sms, another for email and respective radio buttons as well.

if i select sms then i should display div related to sms and if email i should hide the sms div and display the email div.

here is my code


and my java script is



Am i following the right procedure? But it is not working in my browser, but i am not using any IDE.
I think my code have some syntax errors as well, i am unable to debug whats the problem.

Please suggest me to correct my code.

Thanks in Advance,
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ids are singular. You can only have one element with the same id. Give each one their own id [name can stay the same]

You should than used checked.




Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display div's based upon selection of radio Buttons.
 
Similar Threads
How to update a image using servlet?
Please help me regarding the forms selection
How to retrieve div elements in JSP
A problem in hiding a button
Setting radio button value dynamically and rendering partially after ajax request