Radio button in If-Else Statement
843835Feb 26 2002 — edited Feb 26 2002I 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"> </td>
<% app = rs.getString("Application_type"); %>
<td width="123"><b> </b> <b>Application Type:</b></td>
<td width="1" class="txt-label"> </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>
<% } %>