Link to home
Start Free TrialLog in
Avatar of techbots
techbotsFlag for United States of America

asked on

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)


Avatar of thunderchicken
thunderchicken

<% 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>
ASKER CERTIFIED SOLUTION
Avatar of joeposter649
joeposter649

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of techbots

ASKER

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