This topic is locked

hide or show hyperlink based on checkbox

6/25/2009 1:45:58 PM
ASPRunnerPro General questions
T
tigersloft author

I am trying to show or hide a field (web hyperlink) based on a checkbox (visible if checked, hidden if not). So far i have managed to show or hide the field as necessary using a custom format code below. However, although the web address is visible it is not a hyperlink. This is probably remedial but if anyone can assist that would be great.
the code i used to hide or show using custom format on the "View as" settings dialog on the Visual Editor tab is:

--------------------------------------

if rs("Link")="0" then

strValue = ""

end if
--------------------------------------

Thanks,

Trey

J
Jane 6/26/2009

Trey,
try to use this one:

if rs("Link")=0 then

strValue = ""

end if

T
tigersloft author 6/27/2009

Hey Jane, thanks for the reply.. however, perhaps i was unclear. the code i mentioned works as intended. it DOES hide the fields if the check box is not checked and shows it when the box IS checked. the problem is that the links are not hyperlinks. they are just text. i would like them to be hyperlinks (same as using "show link as hyperlink" option). Can you help? Thanks,

J
Jane 7/1/2009

Hi,
here is a sample:

if rs("Link")=0 then

strValue = ""

else

strValue = "<a href=""" & strValue & """>" & strValue & "</a>"

end if