looking for a script...

P

Peter Kelly

i'm just looking for a 'click here to email this page' script...can anyone
help? or refer me to a site where i can find one?

thx
 
T

Tom Pepper Willett

G

Guest

The first part goes into the head

decide what you want to click on example...click here
Highlight click here and for the hyperlink you put javascript:mailpage()
 
K

Kevin Spencer

Click here to email this page. (Freestyle Script)

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
S

Steve Easton

Click here to email this page Wingdings


;-)


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
Click here to email this page. (Freestyle Script)

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
T

Trevor L.

Kevin said:
Click here to email this page. (Freestyle Script)

--
;-),

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

--

But seriously, folks
JS
function mailThisUrl()
{
var subj = "I thought this might interest you..."
var text = "Here is an interesting Website: "

var content = new Array()
content[0] = "mailto:"
content[1] = document.eMailer.address.value
content[2] = "?subject="
content[3] = subj
content[4] = "&body="
content[5] = text
content[6] = parent.document.title
content[7] = " ("
content[8] = parent.location
content[9] = ")"
content = content.join("")
window.location = content
}

HTML
<form name="eMailer" action="">
<b>E-Mail this link to a friend</b><br>
Enter recipient's e-mail:<br>
<input type="text" name="address" size="30"><br>
<input type="button" value="Send this URL" onClick="mailThisUrl();">
</form>

Or you could add the function
function checkEmailAddress(field)
{
/*****
Script: Automatic E-mail This Link Script
With Auto-Capture and Validation
Browsers: IE4-6, NS4-6
Author: etLux
© 2000 www.CodeLifter.com
http://www.codelifter.com
Free for all users, but leave in this header
*****/
// the following expression in () after 'match' must be all on one line...
if (field.value.match
(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
return true
else
{ alert('Please enter a valid e-mail address.')
field.focus()
field.select()
return false }
}
and change the last line of function mailThisUrl() to:
if (checkEmailAddress(document.eMailer.address))
window.location = content


Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top