This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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 ]
 
GeeCON Prague 2014
 
subject: how to retrieve data into radiobuttons