Forums

This topic is locked

Making a clickable email address.

Posted 01 Jul 2003 10:46:19
1
has voted
01 Jul 2003 10:46:19 kirsty burgoine posted:
Hi,
I'm sure this is a very silly question, I would like to know how to make an email address clickable.
For example on our website I have a list of all the shops in the UK that sell a product of ours. All the info is listed in a Microsoft Access 2000 database and its listed on the page using the repeat region function (nothing complicated) what I want to do is instead of having their email address appear on the page like the rest of their details I want people to be able to click a button and it brings up the new email screen with that shops address in the top bar, so that they can email that shop automatically without all the bother of cutting and pasting the address into there email client. Is there a way to do this? I'm using Ultradev4 in Windows XP.
Hope some one can help.
If you want to see what I mean go to www.bandm.co.uk/pages/admira/default.asp and click on dealer list in the side menu.
Thanks

Replies

Replied 01 Jul 2003 16:30:51
01 Jul 2003 16:30:51 Stefan P replied:
Hi Kirsty

The normal way to do this would be coded as follows:

<a href="mailto: ?subject=query">E-mail</a

All you need to do is make it dynamic.

What you need to do is put a text link called, say, 'E-mail', in the repeat region.

Then apply a mailto link, with the address being the field from your recordset.

Your code would look something like this:

<a href="mailto:<%=(rsRecordset.Fields.Item("email".Value)%>?subject=query">E-mail</a>


Hope this is what you're looking for.

Regards

Stefan


DMX | ASP | VBScript | ACCESS | IIS5
Replied 01 Jul 2003 16:42:41
01 Jul 2003 16:42:41 kirsty burgoine replied:
Thanks,
This has worked ish, instead of the email address appearing in the send box I get ?subject=query.
My code looks like this:
<a href="mailto:%=<%=(rsDetails.Fields.Item("email".Value)%>?subject=query">Send
Email</a>
is this wrong?

Kirsty
Replied 01 Jul 2003 17:23:29
01 Jul 2003 17:23:29 Stefan P replied:
Mmm, I'm sure I did it this way before.

Also saw this

www.dmxzone.com/showDetail.asp?TypeId=3&NewsId=2043

maybe of interest to you, I haven't tried it myself

DMX | ASP | VBScript | ACCESS | IIS5
Replied 04 Jul 2003 03:15:17
04 Jul 2003 03:15:17 David Behan replied:
You did the right way alright. If you want to display the email address and make it clickable, here is the code:

<a href="mailto:<% = rsDetails("email" %>"><% = rsDetails("email" %></a>

The reason you are only getting ?subject=query as the link is that the recordset is not returning anything for the record and column you are displaying, i.e. there is nothing in that field!!

I have also come across UD not displaying what is in a field more than once on a page which I found strange so what I do to solve this is:

<% emailtodisplay = rsDetails("email" %>
<a href="mailto:<% = emailtodisplay %>"><% = emailtodisplay %></a>

Hope that helps.

Dave

_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie
Replied 04 Jul 2003 07:31:37
04 Jul 2003 07:31:37 Dave Clarke replied:
Following on from what beano says about UD only displaying a record once on a page, aparently this is to do with the cursor type of the recordset, UD defaults to "Forward Only" but if you change the cursor type to "Dynamic" you can then display the field as many times as you like.

Dave

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
Replied 04 Jul 2003 09:57:18
04 Jul 2003 09:57:18 kirsty burgoine replied:
Thanks thats worked now. If there is no email address for the recordset to use how can I get it to not show the send email link? I'm assuming its similar to the show if command used in the navigation links.

Kirsty
Replied 04 Jul 2003 13:54:02
04 Jul 2003 13:54:02 David Behan replied:
<% emailtodisplay = rsDetails("email" %>

<% IF emailtodisplay <> "" THEN %>
<a href="mailto:<% = emailtodisplay %>"><% = emailtodisplay %></a>
<% END IF %>

Regards,

Dave



_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie
Replied 04 Jul 2003 16:30:54
04 Jul 2003 16:30:54 kirsty burgoine replied:
Thanks loads, that works perfectly.

Kirsty
Replied 08 Jul 2003 14:44:36
08 Jul 2003 14:44:36 David Behan replied:
No problem, anytime.

Dave

_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie

Reply to this topic