Hejhej.
Das werden jetzt mehrere Fragen.
Und, um es voraus zu schicken: Ich habe extrem viel im Netz gesucht, gegoogelt, Firebug benutzt und all das. Sonst würd ich nicht fragen. Hab auch meinen Autodidaktenstolz.
Erst der Code, dann die Fragen:
<html>
<head>
<title>order KATSU apparel</title>
<SCRIPT LANGUAGE="JavaScript">
function checkForm()
{
if(document.mailer.d_name.value=="")
{
alert ("please enter your name");
document.mailer.d_name.focus();
return false;
}
if( document.mailer.d_name.value.length <2 )
{
alert ("your name should consist of more than just one letter...");
document.mailer.d_name.focus();
return false;
}
if(!isNaN (document.mailer.d_name.value))
{
alert ("please limit yourself to the use of letters.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_street.value=="")
{
alert ("please enter your street or p.o.box address.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_city.value=="")
{
alert ("please enter your zip code and city.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_country.value=="")
{
alert ("please enter your country.");
document.mailer.d_name.focus();
return false;
}
if (document.mailer.d_mail.value=="")
{alert ("please enter your email address.");
document.mailer.d_mail.focus();
return false
}
if(document.mailer.d_mail.value.indexOf('@')==-1 ||document.mailer.d_mail.value.indexOf('.')==-1)
{
alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
var zeichen="/ ;:,äüö";
eingabe=document.mailer.d_mail.value;
laenge=eingabe.length;
for( i=0;i<laenge;i++ )
{
badchar=eingabe.charAt(i);
if (zeichen.indexOf(badchar)>-1)
{
alert("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false;
}
}
atPosition=document.mailer.d_mail.value.indexOf('@ ');
if(document.mailer.d_mail.value.indexOf('@',atPosi tion+1)>-1)
{alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
if(document.mailer.d_mail.value.indexOf('.',atPosi tion)==-1)
{alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
punktPosition=document.mailer.d_mail.value.lastInd exOf('.');
if(punktPosition+3>document.mailer.d_mail.value.le ngth){alert("*ERROR*\n invalid email address\n")
return false};
if(punktPosition+5<document.mailer.d_mail.value.le ngth){alert("*ERROR*\n invalid email address\n")
return false};
if(document.mailer.gtct.checked==false
)
{
alert("You need to agree to the GTCT in order to progress.");
return false
}
radio1=
document.forms[0].elements[8].checked;
radio2=
document.forms[0].elements[9].checked;
if(radio1 == false && radio2 == false)
{
alert (" Please choose a payment method.");
return false
}
radio3=
document.forms[0].elements[11].checked;
radio4=
document.forms[0].elements[12].checked;
if(radio1 == false && radio2 == false)
{
alert (" Please decide if you'd like to recieve the newsletter.");
return false
}
//-->
}</script>
<link href="../0809.css" rel="stylesheet" type="text/css">
<noscript>Please activate JavaScript in your browser.</noscript>
</head>
<body>
<form name="mailer" action="mailto
nline@aaa.bb" method="post" enctype="text/plain">
<table width="500" border="0" cellpadding="10" cellspacing="0" >
<tr>
<td > <p><font size="1">size</font>
<select name="size" >
<option>S</option>
<option>M</option>
<option>L</option>
</select>
<font size="1">quantity</font>
<select name="quantity" >
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<font size="1">color</font>
<select name="color" >
<option>mysterious purple</option>
<option>willow grouse white</option>
<option>texas yellow</option>
</select>
<br>
</p>
<table width="475" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="149"><p><font size="1">first name | last name</font></p></td>
<td width="25"><img src="http://www.php.de/images/blind.gif" width="25" height="1"></td>
<td width="301"><input type="Text" name="d_name" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">email</font></p></td>
<td> </td>
<td><input type="Text" name="d_mail" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">street, n° | p.o.box</font></p></td>
<td> </td>
<td><input type="Text" name="d_street" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">zip | city</font></p></td>
<td> </td>
<td><input type="Text" name="d_city" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">country</font></p></td>
<td> </td>
<td><input type="Text" name="d_country" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><p><font size="1">payment method</font></p></td>
<td><p><font size="1"><font size="1"></font></font></p></td>
<td><p> <font size="1">
<input type="Radio" name="ra_payment" value="paypal">
paypal
<input type="Radio" name="ra_payment" value="bank transfer">
bank transfer</font></p></td>
</tr>
</table>
<p> </p>
<p>
<input type="Checkbox" name="gtct" value="agree">
<font size="1">I agree to the <a href="gtct.html"><font size="1">GTCT</font></a>.</font><br>
<br>
<font size="1">do you want to subscribe to the newsletter?</font><font size="1">
<input type="Radio" name="ra_news" value="yes">
ya, man.
<input type="Radio" name="ra_news" value="no">
no way, josé! </font><br>
<br>
</p>
</td>
</tr>
<tr>
<td align="left" >
<input type="Submit" value="order now" form action="thankyou.html">
</td>
</tr>
</table>
</form>
</body>
</html>
Das werden jetzt mehrere Fragen.
Und, um es voraus zu schicken: Ich habe extrem viel im Netz gesucht, gegoogelt, Firebug benutzt und all das. Sonst würd ich nicht fragen. Hab auch meinen Autodidaktenstolz.
Erst der Code, dann die Fragen:
<html>
<head>
<title>order KATSU apparel</title>
<SCRIPT LANGUAGE="JavaScript">
function checkForm()
{
if(document.mailer.d_name.value=="")
{
alert ("please enter your name");
document.mailer.d_name.focus();
return false;
}
if( document.mailer.d_name.value.length <2 )
{
alert ("your name should consist of more than just one letter...");
document.mailer.d_name.focus();
return false;
}
if(!isNaN (document.mailer.d_name.value))
{
alert ("please limit yourself to the use of letters.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_street.value=="")
{
alert ("please enter your street or p.o.box address.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_city.value=="")
{
alert ("please enter your zip code and city.");
document.mailer.d_name.focus();
return false;
}
if(document.mailer.d_country.value=="")
{
alert ("please enter your country.");
document.mailer.d_name.focus();
return false;
}
if (document.mailer.d_mail.value=="")
{alert ("please enter your email address.");
document.mailer.d_mail.focus();
return false
}
if(document.mailer.d_mail.value.indexOf('@')==-1 ||document.mailer.d_mail.value.indexOf('.')==-1)
{
alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
var zeichen="/ ;:,äüö";
eingabe=document.mailer.d_mail.value;
laenge=eingabe.length;
for( i=0;i<laenge;i++ )
{
badchar=eingabe.charAt(i);
if (zeichen.indexOf(badchar)>-1)
{
alert("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false;
}
}
atPosition=document.mailer.d_mail.value.indexOf('@ ');
if(document.mailer.d_mail.value.indexOf('@',atPosi tion+1)>-1)
{alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
if(document.mailer.d_mail.value.indexOf('.',atPosi tion)==-1)
{alert ("*ERROR*\n invalid email address\n");
document.mailer.d_mail.focus();
return false
}
punktPosition=document.mailer.d_mail.value.lastInd exOf('.');
if(punktPosition+3>document.mailer.d_mail.value.le ngth){alert("*ERROR*\n invalid email address\n")
return false};
if(punktPosition+5<document.mailer.d_mail.value.le ngth){alert("*ERROR*\n invalid email address\n")
return false};
if(document.mailer.gtct.checked==false
)
{
alert("You need to agree to the GTCT in order to progress.");
return false
}
radio1=
document.forms[0].elements[8].checked;
radio2=
document.forms[0].elements[9].checked;
if(radio1 == false && radio2 == false)
{
alert (" Please choose a payment method.");
return false
}
radio3=
document.forms[0].elements[11].checked;
radio4=
document.forms[0].elements[12].checked;
if(radio1 == false && radio2 == false)
{
alert (" Please decide if you'd like to recieve the newsletter.");
return false
}
//-->
}</script>
<link href="../0809.css" rel="stylesheet" type="text/css">
<noscript>Please activate JavaScript in your browser.</noscript>
</head>
<body>
<form name="mailer" action="mailto
<table width="500" border="0" cellpadding="10" cellspacing="0" >
<tr>
<td > <p><font size="1">size</font>
<select name="size" >
<option>S</option>
<option>M</option>
<option>L</option>
</select>
<font size="1">quantity</font>
<select name="quantity" >
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<font size="1">color</font>
<select name="color" >
<option>mysterious purple</option>
<option>willow grouse white</option>
<option>texas yellow</option>
</select>
<br>
</p>
<table width="475" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="149"><p><font size="1">first name | last name</font></p></td>
<td width="25"><img src="http://www.php.de/images/blind.gif" width="25" height="1"></td>
<td width="301"><input type="Text" name="d_name" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">email</font></p></td>
<td> </td>
<td><input type="Text" name="d_mail" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">street, n° | p.o.box</font></p></td>
<td> </td>
<td><input type="Text" name="d_street" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">zip | city</font></p></td>
<td> </td>
<td><input type="Text" name="d_city" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td><p><font size="1">country</font></p></td>
<td> </td>
<td><input type="Text" name="d_country" value="" size="30" maxlength="50" ></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><p><font size="1">payment method</font></p></td>
<td><p><font size="1"><font size="1"></font></font></p></td>
<td><p> <font size="1">
<input type="Radio" name="ra_payment" value="paypal">
paypal
<input type="Radio" name="ra_payment" value="bank transfer">
bank transfer</font></p></td>
</tr>
</table>
<p> </p>
<p>
<input type="Checkbox" name="gtct" value="agree">
<font size="1">I agree to the <a href="gtct.html"><font size="1">GTCT</font></a>.</font><br>
<br>
<font size="1">do you want to subscribe to the newsletter?</font><font size="1">
<input type="Radio" name="ra_news" value="yes">
ya, man.
<input type="Radio" name="ra_news" value="no">
no way, josé! </font><br>
<br>
</p>
</td>
</tr>
<tr>
<td align="left" >
<input type="Submit" value="order now" form action="thankyou.html">
</td>
</tr>
</table>
</form>
</body>
</html>

Kommentar