Display True/False Value in Checkbox

M

mwagoner

I am trying to display the value of a true/false value in my table
through the use of the following:

<input type=checkbox name=FieldLabCheck value=" &
objRecordset("FieldLaborSuper") & "></input>

it doesn't work though.... what am I doing wrong???

thanks
 
B

Bob Barrows [MVP]

I am trying to display the value of a true/false value in my table
through the use of the following:

<input type=checkbox name=FieldLabCheck value=" &
objRecordset("FieldLaborSuper") & "></input>

it doesn't work though.... what am I doing wrong???

Failing to read up on html
(http://msdn.microsoft.com/workshop/author/dhtml/dhtml_node_entry.asp).

An input element with type ="checkbox" has an attribute called "checked",
the presence of which causes the checkbox to be ... well ... checked. I
would create a function that returns "checked" if passed a True boolean, and
"" if passed False:

%>
....
function SetCheckbox(arg)
if arg then
SetCheckbox="checked"
else
SetCheckbox=""
end if
end function
%>

<input type=checkbox name=FieldLabCheck
<%=SetCheckbox(cBool(objRecordset("FieldLaborSuper") )) %> >

HTH,
Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top