[Javascript] mailto link question.

Brian Gordon microsteel at adelphia.net
Thu Oct 16 21:21:35 CDT 2003


heres a sample form page (needlessly written in perl of couse :):

#!/usr/local/bin/perl

print "Content-type: text/plain\n\n";


print qq~

<html>
<head>
<title>Email Anonymously</title>
<style>
</style>
<script>

/*
Submit Once form validation-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit
http://dynamicdrive.com
*/

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset"
)
//disable em
tempobj.disabled=true
}
}
}
</script>
</head>
<body>
<p align="right"><form
action="http://goonlagoon.hypermart.net/cgi-bin/search.pl"
method="post"><input type="text" value="" style="border:1 solid;"
name="query">&nbsp;&nbsp;<input type="submit" value="Search"
style="background:transparent;border-left:1px solid;border-top:1px
solid;"></form><hr><br><br>
<a href="http://goonlagoon.hypermart.net/main.pl"><img border="0"
src="/images/logosmall1.gif"
style="position:absolute;top:12px;left:12px;border:0px;"></a>
<form action="http://goonlagoon.hypermart.net/cgi-bin/email.cgi"
method="post" onSubmit="submitonce(this)">

<P>To:&nbsp;&nbsp;&nbsp;
<input type="text" size="40" name="recip" style="border:solid 1px;">
<br>
CC:&nbsp;&nbsp;&nbsp;
<input type="text" size="40" name="cc" style="border:solid 1px;">
<br>
BCC:&nbsp;&nbsp;&nbsp;
<input type="text" size="40" name="bcc" style="border:solid 1px;">
</p>
<P>Your E-mail Address:<BR>
<input type="text" size="40" name="sender" style="border:solid 1px;">
</P>

<P>The Subject:<BR>
<input type="text" size="40" name="sub" style="border:solid 1px;">
</P>

<P>I would like to keep my name and email address
anonymous.&nbsp;&nbsp;<input type="checkbox" name="priv"></p>

<P>The body of the email:<BR>
<textarea name="email" rows="11" cols="60" wrap style="border:solid 1px;">
</textarea>
</P>

<P><input type="submit" value="Send">&nbsp;&nbsp;<input type="reset"
value="Clear">
</P>
</form>
</body>
</html>
<noscript><noscript><noscript><noscript>
<plaintext><plaintext>

~;

#END



that <noscript><noscript><noscript><noscript> <plaintext><plaintext> is why
the site is no longer up if you know what I mean...



----- Original Message ----- 
From: <mercer.b at comcast.net>
To: <javascript at LaTech.edu>
Sent: Thursday, October 16, 2003 9:58 PM
Subject: [Javascript] mailto link question.


> Hello all!
>
> I came up with a very easy script that iterates through a form and
concocts an email message, the body of which is the contents of all the form
elements and their values. Unfortunately all the form fields and their
values come out in a continuous string: FirstName=Joe,LastName=Blow etc. I
tried putting "/r/n" after each form elemenr in rhe script but this doesn't
help. Would any of you Javascript gurus have an idea how I can put a
carriage return/line feed in the body of a mailto link?? I come from the
Pascal world and Javascript is quite net to me at this point, this is for my
nephew's Cub Scout troop's web site.
>
> Many Tnanks.
> Brian M.
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list