royalcyber
asked on
How to make the checkbox work with the boolean variable
Hi
I have this code
<td width='15%' align = 'center'><input type="checkbox" value="<%=next_IREMCustome r.getRegis tration_ty pe()%>"></ td>
registration_type is a boolean field which passes either true or false
Now what I need is that when the value is true the checkbox shows a checkmark and if it is false it doesn't show.
Any help will be greatly appreciated
I have this code
<td width='15%' align = 'center'><input type="checkbox" value="<%=next_IREMCustome
registration_type is a boolean field which passes either true or false
Now what I need is that when the value is true the checkbox shows a checkmark and if it is false it doesn't show.
Any help will be greatly appreciated
You could do something like this:
<td width='15%' align = 'center'><input type="checkbox" <% if (next_IREMCustomer.getRegi stration_t ype()) out.println("CHECKED"); %>"></td>
<td width='15%' align = 'center'><input type="checkbox" <% if (next_IREMCustomer.getRegi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<td width='15%' align = 'center'><input type="checkbox" value="<%=next_IREMCustome
...uhh on second thought what you'll really wanna do is something more like this:
<td width='15%' align = 'center'><input type="checkbox" value="whatever ya wanna post to the server" <%if(next_IREMCustomer.get
the value attribute has nothing to do with the checked state of the checkbox, it's simply the string that get's posted to the server and can be anything you want. When you check to see if the checkbox is checked it's just by assuring that it's not null, so in most situations the value is not even really used.
Let me know if ya gots questions.
Cheers,
Jesse