This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes how to retrieve data into radiobuttons 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 » Java » JSP
Bookmark "how to retrieve data into radiobuttons" Watch "how to retrieve data into radiobuttons" New topic
Author

how to retrieve data into radiobuttons

SEEMANT SRIVASTAVA
Greenhorn

Joined: May 21, 2007
Posts: 1
I want to check or uncheck radiobuttons according to the value retrieved from databse in jsp.

Ex. two radiobuttons showing Yes and No

After retrieving a value of 'yes' from database , i want to check Yes radiobutton and vice versa.
karthick swami
Greenhorn

Joined: May 14, 2007
Posts: 4
There will be a property for the radio button.
This property has to be set with the appropriate value taken from DB.

Depending on the radio button property the radio button in the form can be checked or not.

eg.<INPUT TYPE=RADIO NAME="propertyName" VALUE="yes"

<% if (user.getProperty()=="yes") { %>
checked="checked" %> } %>
>YES
</INPUT>

<INPUT TYPE=RADIO NAME="propertyName" VALUE="no"
<% if (user.getProperty()=="no") { %>
checked="checked" %> } %>
>NO</INPUT>

Instead of this scriplets logic:if can also be used to check the value of the property.
[ May 24, 2007: Message edited by: karthick swami ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retrieve data into radiobuttons
 
Similar Threads
CheckBoxes and RadioButtons
radiobutton selection
Last question for today-->Radio button
Use of RandomAccessFile class under Swing
How can i insert JRadioButton to Cell in JTable