File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Cattle Drive and the fly likes Radio buttons and how to set them....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Radio buttons and how to set them......." Watch "Radio buttons and how to set them......." New topic

Radio buttons and how to set them.......

Carol Murphy
village idiot

Joined: Mar 15, 2001
Posts: 1202
I've been working on JDBC 3, and to my delight I actually have been able to edit videos. At least it worked for a while before I tried to tackle the issue of having the form spring completed to the page before editing it..........Now it's not working so well.
Can anyone clue me in on the best way to tell my servlet which radio button to select? My html reference book shows an attribute that can be placed inside the tag to make one button selected automatically when a form appears, but is there another way to tell my servlet to check a certain box without using that attribute?
Perhaps I'm looking at this wrong, but it seems like the method I would have to create to utilize this attribute would be very clumsy.
I'm not having a problem with the text fields, just the radio buttons.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I am not very familiar with servlets/JSP but my understanding is that you can only send what HTML allows over to your client. So in the form you generate you must use the CHECKED attribute on the INPUT tag:

PS How do I turn HTML interpretation off?
[ October 20, 2002: Message edited by: Barry Gaunt ]
Put a space between your opening angle brace and the first word. Or use the < substitution for the angle brace.
[ October 20, 2002: Message edited by: Marilyn de Queiroz ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: Radio buttons and how to set them.......
It's not a secret anymore!