Click to See Complete Forum and Search --> : Help with 'Mailing list'


D'oh
04-25-2003, 07:05 AM
Hi,
I am trying to put the 'Mailing List' on my web site. It works, up to a point! It does not Mail the information back to me, viz: Email address; name; address; city; state and zip code back to me. I understand through my reading on Java Script that this code is very picky where line breaks are concerned.
I get a blank email back to me, none of the details asked for.
I have tested this both from my site and on my computer. Where am I going astray please?
I wonder if you could help me?
The code is attached as 'lifted' out from the page, and placed exactly where, asked in the directions. I get no errors on the page, but as I said, the Email is blank apart from the subject=TJS - Mailing List.' The body is totaly blank!
I am a senior who runs the web site for my Ferret Group.

Thank you in anticapation for you valued help and thanks for the code on your site, it is very help and instructive.

Yours

D'oh



<!-- TWO STEPS TO INSTALL MAILING LIST:

1. Paste the coding into the HEAD of your HTML document
2. Put the last code into the BODY of your HTML document -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function resetform() {
document.forms[0].elements[1]=="";
}
function submitForms() {
if (isEmail() && isFname() && isLname() && isAddress() && isCity() && isState() && isZip())
if (confirm("\n You are about to e-mail your submission. \n\nYES to submit. NO to abort."))
{
alert("\nYour submission will now be sent. \n\n Use the Return Button once the submission is complete to return to my home page.\n\n\n Thank you for joining our mailing list!");
return true;
}
else
{
alert("\n You have chosen to abort the submission.");
return false
}
else
return false;
}
function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("\n The E-Mail field is blank. \n\n Please enter your E-Mail address.")
document.forms[0].elements[1].focus();
return false;
}
if (document.forms[0].elements[1].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[1].value.indexOf ('.',0) == -1) {
alert ("\n The E-Mail field requires a \"@\" and a \".\"be used. \n\nPlease re-enter your E-Mail address.")
document.forms[0].elements[1].select();
document.forms[0].elements[1].focus();
return false;
}
return true;
}
function isFname() {
if (document.forms[0].elements[2].value == "")
{
alert ("\n The First Name field is blank. \n\n Please enter your first name.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}
function isLname() {
if (document.forms[0].elements[3].value == "") {
alert ("\n The Last Name field is blank. \n\nPlease enter your last name.")
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isAddress() {
if (document.forms[0].elements[4].value == "") {
alert ("\n The Address field is blank. \n\nPlease enter your address.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isCity()
{
if (document.forms[0].elements[5].value == "")
{
alert ("\n The City field is blank. \n\nPlease enter your city.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isState() {
if (document.forms[0].elements[6].value == "") {
alert ("\n The state field is blank.\n\nPlease enter your state.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isZip() {
if (document.forms[0].elements[7].value == "") {
alert ("\n The Zip code field is blank. \n\nPlease enter your Zip code.")
document.forms[0].elements[7].focus();
return false;
}
return true;
}
// End -->
</SCRIPT>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<CENTER>
<FORM enctype="text/plain" name="addform" method='get'
action='mailto:antispammer@earthling.net?subject=TJS - Mailing List' onSubmit="return submitForms()">
<TABLE border=3 width=430 cellpadding=10><TD align="center">
<strong>
<font face="arial" size=+2>Join the Mailing List!</font>
</strong>
</TABLE>
<input type="hidden" name="Form" value="Submit Sub">
<TABLE border=3 cellspacing=0 cellpadding=2 bgcolor="#C0C0C0">
<tr valign=baseline>
<TD>
<font face="arial">Email Address:</font>
</TD>
<TD>
<input type=text name="Email Address" size=35,1 maxlength=80>
</TD>
</tr>
<tr>
<TD>
<font face="arial">First Name:</font>
</TD>
<TD>
<input type=text name="First Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">Last Name:</font>
</TD>
<TD>
<input type=text name="Last Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">Address:</font>
</TD>
<TD>
<input type=text name="Address" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">City:</font>
</TD>
<TD>
<input type=text name="City" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">State:</font>
</TD>
<TD>
<input type=text name="State" size=10,1 maxlength=25>
</TD></tr>
<tr>
<TD>
<font face="arial">Zip Code:</font>
</TD>
<TD>
<input type=text name="Zip" size=20,1 maxlength=35>
</TD></tr></TABLE>
<br>
<center>
<input type="submit" value=" Submit ">
<input type="button" value=" Return " onclick="window.location='your-page.html'">
<input type="reset" value="Reset Form" onclick=resetform()>
</FORM>
</CENTER>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 4.56 KB -->

Asch
04-25-2003, 07:24 AM
A form doesnt work only like thaht you l need a script "cgi or php", this is only the form on the html page !

Ther are allready very good & complet full scripts , you don t need to make one !!

Matts scripts are one of the besst for free !! check it out

http://www.scriptarchive.com/


have fun

asch

Royal programming:)

:D

AdamGundry
04-25-2003, 07:46 AM
Incorrect. Most major browsers can use mailto as the action for a form, meaning they will email the results using the user's local email program. The user will usually get a message warning them this is happening, and asking them to confirm the form being emailed.

I can't see what is wrong with your code, but some of the others might. The fact it is not server-side should not be a problem.

Adam

Asch
04-25-2003, 07:54 AM
adam,

hmm didnt know that...interesting :O)...

but still i prefere cgi...duhhh

asch

AdamBrill
04-25-2003, 08:41 AM
Try changing this:<FORM enctype="text/plain" name="addform" method='get'
action='mailto:antispammer@earthling.net?subject=TJS - Mailing List' onSubmit="return submitForms()"> to this:<FORM enctype="text/plain" name="addform" method='get'
action='mailto:antispammer@earthling.net' onSubmit="return submitForms()">
<input type=hidden name=subject value="TJS - Mailing List">
Sometimes the ?subject thing messes it up... BTW, the value of the hidden field will go in the subject line...