If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Assign a href to a Dim ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-07, 06:13
squizoid squizoid is offline
Registered User
 
Join Date: Mar 2005
Location: Wellington, New Zealand.
Posts: 28
Assign a href to a Dim ?

Hi all, I have setup an online survey system and am trying to simplify things by viewing all surveys (is working), so that I can email the initial invite, then remiders at a later stage with the push of a button. I have setup a field in the db called email_invite. When the view survey page loads I need it to evaluate email_invite (1 for NOT sent and 2 for sent) and assign a href to a Dim if the result is 1 for NOT sent. Can this be done? Here is a sample of what I have so far, but it throws an error because of all the "s

<% if not rsXXX.eof then
do while not rsXXX.eof

Dim testlink

if rsXXX(email_invite) = 1 then

testlink = "<a href="admin_email_invite.asp?autoID=<%=rsXXX("se_i d")%>"><img src="../assets/email.gif" width="13" height="16" alt="Email Invite" border="0">"

else

testlink = "sent"

end if

%>
<tr>
<td width="5%"><p><%=rsXXX("se_id")%></p></td>
<td width="10%"><p><%=rsXXX("se_name")%></p></td>
<td width="10%"><p><%=rsXXX("se_date")%></p></td>
<td width="10%"><%=testlink%</td>
</tr>
<% rsXXX.movenext
loop
%>

You should get the idea of what i'm trying to acheive from all the above, but if not please feel free to ask any questions. If this can't be done I will need to come up with another solution.
Reply With Quote
  #2 (permalink)  
Old 03-05-07, 16:21
squizoid squizoid is offline
Registered User
 
Join Date: Mar 2005
Location: Wellington, New Zealand.
Posts: 28
Hi, have found the solution which works fine, I am just a bit unsure if the value passed with the url will work. guess I will find out when I have developed the admin_email_1.asp page

Here is what works: just needed "" instead of " and also needed to remove the <%....%> from the string

do while not rsXXX.eof

Dim testlink
Dim autoID
autoID = rsXXX("se_id")

if rsXXX("se_email_1") = 1 then
testlink = "<a href=""admin_email_1.asp?se_id=autoID""><img src=""../assets/delete.gif"" width=""13"" height=""16"" alt=""Delete Details"" border=""0""></a>"
else
testlink = "Sent"
end if
Reply With Quote
  #3 (permalink)  
Old 03-08-07, 05:36
squizoid squizoid is offline
Registered User
 
Join Date: Mar 2005
Location: Wellington, New Zealand.
Posts: 28
Hi, I did have problems adding the values passed with the url in my last post. Here was the final solution:

do while not rsXXX.eof

Dim email_1, email_2, email_3, email_results
Dim tempID
tempID = rsXXX("se_id")

if rsXXX("se_email_1") = 1 then
email_1 = "<a href=""admin_email_1.asp?se_id="
email_1 = email_1 & tempID
email_1 = email_1 & """><img src=""../assets/mail.gif"" width=""14"" height=""10"" alt=""Email Invite"" border=""0""></a>"
else
email_1 = "<img src=""../assets/tick.gif"" width=""16"" height=""16"" border=""0"">"
end if
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On