Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 908
  • Last Modified:

building mailto: in VBScript ASP

I've done this a dozen times before and it has worked - so I am beating my head against the wall trying to figure out what the problem is and how to fix it.

Here is my code:

          Email:    
          <% Response.Write "<a href='mailto:" & (rsMembersList.Fields.Item("Email").Value) & "'>" & (rsMembersList.Fields.Item("Email").Value) & "</a>" %>
          <br>
          Website:
          <% Response.Write "<a href='http://" & (rsMembersList.Fields.Item("Website").Value) & "'>" & (rsMembersList.Fields.Item("Website").Value) & "</a>" %>

What shows up in the source code in the browser is this:

          Email:    
          <a href='mailto:jane@doe.org'></a>
          <br>
          Website:
          <a href='http://www.techbots.com'>www.techbots.com</a>

Why isn't my email address showing up in the browser? It isn't getting plugged in between the "<a href='mailto:jane@doe.org'>" and the "</a>" and I don't know why. Obviously it is reading it in from the database the first time. I have checked my syntax a hundred times and can't for the life of me figure out why this won't work. I even copied and pasted from another website I did with the exact same code - it works on the other website and not this one. (BTW they are hosted on the same server)


0
techbots
Asked:
techbots
1 Solution
 
thunderchickenCommented:
<% Response.Write "<a href='mailto:" & rsMembersList.Fields.Item("Email").Value & "'>" & rsMembersList.Fields.Item("Email").Value & "</a>" %>

You could also try this:

%><a href='mailto<%=rsMembersList.Fields.Item("Email").Value%>'><%=rsMembersList.Fields.Item("Email").Value%></a>
0
 
joeposter649Commented:
Is there a memo field in the rsMembersList?  If so make sure it's at the end of the rs.
0
 
techbotsAuthor Commented:
Joeposter - You found the problem and win the prize!! I had the email field as a memo in the database - and there was another text field after it. I never would have dreamed to check that. I changed it to text and it worked without having to change any coding.

Bravo! Thanks a million.

Debie
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now