Vous êtes sur la page 1sur 3

<head>

<script language="javascript">

<!-- 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>

<!-- continue -->

<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>

<!-- end script size: 4.56 kb -->

Vous aimerez peut-être aussi