To:

Your Message:


One of the few javascripts that can be done in place of CGI. When you place the form above on your page, visitors can recommend your site to a friend with a push of a button. It is a lot faster and the e-mail looks almost exactly like those of the top-notch CGI recommendation services. Recommend It is also highly customizable (help given in the color coding below the source). The only minus is that you can't use Recommend It if you're behind a firewall, but very few non-collegiate viewers are under this description.

The source..


<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com


var YourSubject = "Check out this Site - http://www.javascript-page.com"; 

var theE, theB, newB;

function changeLoc() {
theE = document.MailForm.toemail.value;
newB = "\n" + document.MailForm.thebody.value;
theB = document.MailForm.Message.value;

if (document.RealForm.Message.value.indexOf(newB) == -1) 
  document.RealForm.Message.value =  newB + theB;
else if (document.RealForm.Message.value.indexOf(theB) == -1) 
  document.RealForm.Message.value = theB;


document.RealForm.action = "mailto:"+theE+"?subject="+YourSubject;
}

//-->
</script>
<br>
<form name="MailForm" method="get" action=" ">
<b>To: </b> <input type="text" name="toemail" size=30>
<br>
<B>Your Message:</B> <br>
<textarea name="thebody" cols="60" rows="6"></textarea>
<input type="hidden" name="Message" value="

Get tons of free javascripts for your page at Nic's JavaScript Page, 
including this recommendation form that allows your visitors to 
recommend your site to friends with the push of a button.  Just 
check out the URL below:

http://www.javascript-page.com">
<br>
</form>
<form name="RealForm" method="post" action=" " ENCTYPE="text/plain">
<input type="submit" value="Recommend Page" onmousedown="changeLoc();">
<input type="hidden" name="Message">
</form>

Color coding..


  Change the subject and body of the letter, respectively, by altering the text of this color as you come across it.
  Delete the lines in dark green to get rid of the option that allows the user to input his own message.