Checkbox issue

Actually i want to read the database value for the checkbox and then want to display in a table if the checkbox is checked or unchecked,but wheni am giving this syntax if the condition is "on" then it is displaying the box with a tick otherwise it is not showing the box and the rest of the table.

It is an urgent issue for me,i will be very greatful if someone can help me on this.the syntax is:

<td style="border-right:solid 1px black;border-top: black 1px solid" width="5%">

<% if(inputsm1.equals("on"))

{

%>

<input type="checkbox" checked name="inputsm1"></td>

<% }

else {

%>

<input type="checkbox" name="inputsm1"></td>

<%} %>

[735 byte] By [newbeana] at [2007-11-27 11:11:34]
# 1

In your javascript fn,

if (document.getElementById("inputsm1").value == true) {

<%

%>

}

skp71a at 2007-7-29 13:49:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

but in database the value for the checkbox field is "on",and i am checking it after getting the database value for that field in a variable from the resultset like

inputsm1 = rs21.getString("Study_model");

and then writing this code:

<td style="border-right:solid 1px black;border-top: black 1px solid" width="5%">

<% if(inputsm1.equals("on"))

{

%>

<input type="checkbox" checked name="inputsm1" ></td>

<% }

else {

%>

<input type="checkbox" name="inputsm1"></td>

<%} %>

newbeana at 2007-7-29 13:49:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

and it is displaying the table very well if the checkbox value is "on" but it is doing nothing if checkbox value is null.

newbeana at 2007-7-29 13:49:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

equalsIgnoreCase here:

if(inputsm1.equals("on"))

skp71a at 2007-7-29 13:49:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...