Forums

This topic is locked

Dynamic images not working

Posted 24 Aug 2001 12:27:10
1
has voted
24 Aug 2001 12:27:10 Per Wilhelmson posted:
Hello. This is my first message to this list.
I have a problem with dynamic images (or checkbox) at a resultpage.
If the value in a field(True/False) is "True" the checked images is chosen.
I cant get this to work, the other values is working well at the resultpage, (and the value True or False for this field), its showing 10 records at eath pages, but not if I tries to get it to work with dynamic images. The idnumber is the primary key.
The database is Access 2000 (Swedish version).

The recordset get its value from a form.
SELECT SurName, FirstName, InstitutionName, ConAddress, ConZipCode, ConCity, ConCountry, Telephone, Email1, useInstitutionAddress, idnumber
FROM address
WHERE SurName LIKE 'MMColParamSN%' AND FirstName LIKE 'MMColParamFN%' AND ConCountry LIKE 'MMColParamCoun'

It look like this in the code made by Ultra dev:
<%
Dim RSresultsIndiv__MMColParamSN
RSresultsIndiv__MMColParamSN = "%"
if (Request.QueryString("txfSurN" <> "" then RSresultsIndiv__MMColParamSN = Request.QueryString("txfSurN"
%>
<%
Dim RSresultsIndiv__MMColParamFN
RSresultsIndiv__MMColParamFN = "%"
if (Request.QueryString("txfFirstN" <> "" then RSresultsIndiv__MMColParamFN = Request.QueryString("txfFirstN"
%>
<%
Dim RSresultsIndiv__MMColParamCoun
RSresultsIndiv__MMColParamCoun = "%"
if (Request.QueryString("txfCountry" <> "" then RSresultsIndiv__MMColParamCoun = Request.QueryString("txfCountry"
%>
<%
set RSresultsIndiv = Server.CreateObject("ADODB.Recordset"
RSresultsIndiv.ActiveConnection = MM_connSAMP2_STRING
RSresultsIndiv.Source = "SELECT SurName, FirstName, InstitutionName, ConAddress, ConZipCode, ConCity, ConCountry, Telephone, Email1, useInstitutionAddress, idnumber FROM address WHERE SurName LIKE '" + Replace(RSresultsIndiv__MMColParamSN, "'", "''" + "%' AND FirstName LIKE '" + Replace(RSresultsIndiv__MMColParamFN, "'", "''" + "%' AND ConCountry LIKE '" + Replace(RSresultsIndiv__MMColParamCoun, "'", "''" + "' ORDER BY SurName ASC"
RSresultsIndiv.CursorType = 0
RSresultsIndiv.CursorLocation = 2
RSresultsIndiv.LockType = 3
RSresultsIndiv.Open()
RSresultsIndiv_numRows = 0
%>

In the code after recordset I have wrote this code to check if the value is true or false, and change images depending of that, its not working, it display the unchecked images all the time:
<%
Dim vrPic
if (RSresultsIndiv.Fields.Item("useInstitutionAddress".Value) = "True" then
vrPic = "../images/checked.gif"
Else
vrPic = "../images/unchecked.gif"
End if
%>

Here is the place for the images:
<img src="<%=vrPic%>" width="18" height="13">

---------

This is working! It gives the value of True or False:
<%=(RSresultsIndiv.Fields.Item("useInstitutionAddress".Value)%>
----------

Have tested this to, its not working at all:
<input <%If (CStr(RSresultsIndiv.Fields.Item("useInstitutionAddress".Value) = CStr("True") Then Response.Write("CHECKED" : Response.Write(""%> type="checkbox" name="checkbox" value="checkbox">
---------

I need help to solve this. Is it something with the values from Access, or the Recordset?

Per


Reply to this topic