View Full Version : 'refer a friend' javascript?

07-30-2002, 01:25 AM
Is there a script available that allows you to let the surfer refer your site to a friend through a pop-up form of some kind. You know the kind where they enter their email and their friends emails and maybe it includes the url and a message, etc.?

thanks :)

Graeme Hackston
07-30-2002, 04:06 PM
I pretty sure I've seen scripts like that. Try a google search


07-30-2002, 05:23 PM
It uses the clients default email application:

function sender() {
emls = document.form1.emls.value;
subj = "You gotta see this site";
bod = "You gotta check out this site: "+window.location+"";
loc = "mailto:"+emls+"?subject="+subj+" &body="+bod+"";

Seperate emails woth commas --> , <--

<form name="form1" onSubmit="sender(); return false;">
<input type="text" name="emls">
<input type="submit" value="Send">

If you want it to go to the recipient directly you'll need server-side.

08-05-2002, 12:29 PM
I have used your method to call the client email program to send an email. Is it possible I can put in a few lines of text in the email body. I somehow do not know/cannot put a linefeed in the body.

Any help is appreciated.