Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Radio button in If-Else Statement

843835Feb 26 2002 — edited Feb 26 2002
I need help in the following code....I need to display which radio button is checked based on data in the database.....

for example, in this code, i want to display the "FTP" radiobutton as being checked if the value in the database is stored as FTP, and display the"Database" radiobutton as being checked if value stored as Database.

My If-Else Statement won't work, so please help!!

<%
while(rs.next())
{
%>
<td width="4">&nbsp;</td>
<% app = rs.getString("Application_type"); %>
<td width="123"><b> </b> <b>Application Type:</b></td>
<td width="1" class="txt-label">&nbsp;</td>
<% if (app == "FTP")
{ %>
<td colspan="2" class="txt-body"><b>
<input type="radio" name="radiobutton" value="FTP" checked>
</b> FTP
<input type="radio" name="radiobutton" value="Database">
Database</td>
<%
}
else
{
%>
<td colspan="2" class="txt-body" width="497"><b>
<input type="radio" name="radiobutton" value="FTP">
</b> FTP
<input type="radio" name="radiobutton" value="Database" checked>
Database</td>
<% } %>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2002
Added on Feb 26 2002
3 comments
273 views