Two Laptop Bag*
The moose likes HTML, CSS and JavaScript and the fly likes Please help me regarding the forms selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Please help me regarding the forms selection" Watch "Please help me regarding the forms selection" New topic
Author

Please help me regarding the forms selection

Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
Hello Guys,

I am just registered here.Thank you one and all for the support.

I have a html form which has many radio buttons and each radio button has some checkboxes.I have to display a particular form based on the radio button selection and checkboxes of that radio button. How can I do this? Can this be done using JavaScript.? Please help me


Thanks a lot!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Certainly JavaScript would be useful for this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
Thank you very much.Will start learning
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Be sure to include CSS in your studies. It's easy to use CSS to hide and show elements on the page under JavaScript control.
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
Sure Bibeault .Thank you so much!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

You're welcome.

A bit of etiquette: in Western cultures it is considered rude to call someone by just their last name. It would be proper to call me "Bear" informally, or "Mr. Bibeault" to be more formal. Here on the Ranch, the informal greeting is OK.
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
oh my god..I am really sorry Mr.Bibeault .I donot know that.Thank you very much for letting me know this.Please dont mind.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Ravi kumark wrote:oh my god..I am really sorry Mr.Bibeault .I donot know that.Thank you very much for letting me know this.Please dont mind.

No problem. The Ranch is a learning site. We're all here to learn about things -- even if it's just about other cultures.
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
thank you!
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
Hello bear,

Here is my code.I have 3 radio buttons.Whenever I clicked on one of them, remaining should hide or not visible.But I am not able to do that.
I am not understanding where I have done wrong.Please help me.



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

First of all, forget the visibility property. All you need to do is to switch the display property between none and block. Refactor the code to do that and then we can look at it again.
Ravi kumark
Greenhorn

Joined: Apr 01, 2012
Posts: 7
Hi Bear ,

Sorry for the bad indentation.I have tried by doing those changes.But still I am not able to get what I wanted .


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

What have you done to debug the problem? Just looking at the code and scratching your head isn't going to help.

Have you even determined if the event handlers are firing? (Hint: they're likely not)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

We're also going to fix some other problems with the code.

  • Do you really think that 'R' is a good id for an element? 'F'?
  • bgcolor is deprectaed. Use CSS.
  • <center> is deprecated. Use CSS.
  • == true in an if conditional is redundant.
  • Non-quoted values are legal, but sloppy. Quote all attribute values.
  • Where's the DOCTYPE declaration?
  • Why the use of the <pre> tag?


  • That's enough for now.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Please help me regarding the forms selection
     
    Similar Threads
    changing form input fields in the div
    Check a checkbox after hitting a reset button
    radio button values
    radio buttons not retaining values
    Redrawing the UI