Discussion Locked

displaying boolean fields in asp

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using the 'GenericDB' asp code I found on the web. Everything works great except I can't seem to display boolean fields as either a checkbox or radio button on the 'List' and 'View' screens. They currently display as 'Yes' or 'No'. I can only find some code on the web to change the 'Edit' screen. Can anyone help?

5 replies

by mark fenwick

Without knowing the code you have already or what you are trying to achieve, I can only suggest a method that I have used before to pre-populate a check box on a form depending on the state of a boolean variable.

EG:

<% If mBoolean Then %>
<% Else %>

<% End If %>

Hope this is of use!

Mark

by gbworld

<%
bolSample = Request("sampleBoolean")
%>
>
>

To make this generic, you could check the datatype of the value and then run this code if datatype equaled the integer value for a boolean.

For a checkbox, checked if true, otherwise unchecked. Note that you will have to convert form yes/no totrue/false in your code (not necessarily true as the numeric value should convert without intervention, but true if you are testing True in VBScript or JavaScript).

Greg

This discussion is closed to new replies.