Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Location
    Wellington, New Zealand.
    Posts
    28

    Unanswered: 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.

  2. #2
    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

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •