Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Display div's based upon selection of radio Buttons.

 
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic