Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send to a friend and e-mail form

Status
Not open for further replies.

hassified

Technical User
Jun 25, 2002
43
US
Ok, I've searched the internet and can not find what i want.
I need to have a form can send my URL address to a visitors
friend (if they want) and also send me an e-mail with any comments or questions. I would like it to have the subject
auto filled. Can this be done?? If so, is there a site to get script??
thanks in advanced
 
here, i think this is what you want:
Code:
<html>
<head>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function sendToFriend(f)
{
email = f.email.value;
subject = 'Check out' + document.location.href + '!';
eSubject = escape(subject);
document.location.href = 'mailto:'+email+'?subject='+eSubject;
}
function sendComments(f)
{
comments = f.comments.value;
subject = 'Comments And Stuff';
eSubject = escape(subject);
email = 'YOUR_EMAIL_HERE!!!';
document.location.href = 'mailto:'+email+'?subject='+eSubject;
}
</SCRIPT>
</head>
<BODY>
<center>
Send this page to a friend!<BR>
<form>
Email Address:<input type='text' name='email'>
<input type='button' value='Send It!' onClick='sendToFriend(this.form)'>
</form>
<BR><BR>
Send me a comment!
<form>
Comments:<BR>
<textarea name='comments'></textarea>
<input type='button' value='Send Em' onClick='sendComments(this.form)'>
</form>
</center>
</body>
</html>

hope it helps! &quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
So true..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top