Print Page | Close Window

Active Email hyperlinks

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5472
Printed Date: 30 March 2026 at 11:31pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Active Email hyperlinks
Posted By: gavinp
Subject: Active Email hyperlinks
Date Posted: 03 September 2003 at 2:58am
I need to now the code to add into my "view data page" from my database so that the Email address submitted is hyperlinked so I can click on it and reply.



Replies:
Posted By: Scotty32
Date Posted: 03 September 2003 at 3:28am

you want it a link in the database?

if so i think you change the "field" to be a hyperlink

if your going to get the results from a ASP Page then do this

<a href="<% if left(rs("field"), 7) <> "mailto:" then Response.Write("mailto:") end if
response.write(rs("Field") & """>" & rs("Field") & "</a>") %>

now, this will check to make sure it puts the "mailto:" in the hyper link if its not there, for this id use a text field in the datebase

if this isnt want you want, then give more details on wot you want to do, and i, or sumone else will try to help better



Posted By: gavinp
Date Posted: 03 September 2003 at 4:02am

This is the source code on my "view" page that deals with the Email address

<tr>
    <td><strong><font size="2" face="Arial">Email Address</font></strong></td>
    <td colspan="3"><strong><font size="2" face="Arial"><%=rst("email_address")%><a href="mailto:">< a href=rst("email_address")</a></font></strong></td>
  </tr>

I wish to view the Email address hyperlinked so I can click on to reply when viewing the data on the resulting page.

 



Posted By: gavinp
Date Posted: 03 September 2003 at 4:04am

Sorry this is the code

<tr>
    <td><strong><font size="2" face="Arial">Email Address</font></strong></td>
    <td colspan="3"><strong><font size="2" face="Arial"><%=rst("email_address")%></font></strong></td>
  </tr>

 



Posted By: Scotty32
Date Posted: 03 September 2003 at 4:11am

yeah the problem is your not making it a hyper link if this is your code,

change it to this and it should work!

<tr>
    <td><strong><font size="2" face="Arial">Email Address</font></strong></td>
    <td colspan="3"><strong><font size="2" face="Arial">
<%

Response.Write("<a href=""")
if left(rs("field"), 7) <> "mailto:" then
      Response.Write("mailto:")
end if
response.write(rs("Email_Address") & """>" & rs("Email_Address") & "</a>")

%>
</font></strong></td>
  </tr>

this will make it a hyper link as you just forgot to put the HTML tag in

copy the code above and it should work

 



Posted By: gavinp
Date Posted: 03 September 2003 at 4:22am

Ok did that however now receive this error:

http://www.petsitter.com.au/admin/

Type mismatch: 'rs'

/admin/viewagreement.asp, line 28



Posted By: Scotty32
Date Posted: 03 September 2003 at 4:30am

yeah sorry i just realised after i posted you dont use "rs"

change the

response.write(rs("Email_Address") & """>" & rs("Email_Address") & "</a>")

to

response.write(rst("Email_Address") & """>" & rst("Email_Address") & "</a>")

now it should work



Posted By: gavinp
Date Posted: 03 September 2003 at 4:38am

ok this is the code as it stands now:

<tr>
    <td><strong><font size="2" face="Arial">Email Address</font></strong></td>
    <td colspan="3"><strong><font size="2" face="Arial"><%

Response.Write("<a href=""")
if left(rst("field"), 7) <> "mailto:" then
      Response.Write("mailto:")
end if
response.write(rst("Email_Address") & """>" & rst("Email_Address") & "</a>")

%></font></strong></td>
  </tr>

and now receiving this error:

http://www.petsitter.com.au/admin/ error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/admin/viewagreement.asp, line 28



Posted By: Scotty32
Date Posted: 03 September 2003 at 4:44am

oooooooooooh am so sorry i didnt notice this, the error is becose of the blue bit, it was "field" but i forgot to change it to wot you wanted:

<tr>
    <td><strong><font size="2" face="Arial">Email Address</font></strong></td>
    <td colspan="3"><strong><font size="2" face="Arial"><%

Response.Write("<a href=""")
if left(rst("Email_Address"), 7) <> "mailto:" then
      Response.Write("mailto:")
end if
response.write(rst("Email_Address") & """>" & rst("Email_Address") & "</a>")

%></font></strong></td>
  </tr>

ok after ALL that, hopefully it SHOULD work
any more problems let me know



Posted By: gavinp
Date Posted: 03 September 2003 at 4:50am
That works!!. Thanks very much Scotty_32



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net