یک ماشین حساب بزرگ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- ONE STEP TO INSTALL ADVANCED CALCULATOR:
1. Paste the coding into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<CENTER>
<FORM name="Keypad" action="">
<!-- Original: http://www.dummyproof.com/javascripts -->
<!--Total Java Scripts 99 - Next Step Software-->
<TABLE>
<B>
<TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<TR>
<TD colspan=3 align=middle>
<input name="ReadOut" type="Text" size=24 value="0" width=100%>
</TD>
<TD
</TD>
<TD>
<input name="btnClear" type="Button" value=" C " onclick="Clear()">
</TD>
<TD><input name="btnClearEntry" type="Button" value=" CE " onclick="ClearEntry()">
</TD>
</TR>
<TR>
<TD>
<input name="btnSeven" type="Button" value=" 7 " onclick="NumPressed(7)">
</TD>
<TD>
<input name="btnEight" type="Button" value=" 8 " onclick="NumPressed(8)">
</TD>
<TD>
<input name="btnNine" type="Button" value=" 9 " onclick="NumPressed(9)">
</TD>
<TD>
</TD>
<TD>
<input name="btnNeg" type="Button" value=" +/- " onclick="Neg()">
</TD>
<TD>
<input name="btnPercent" type="Button" value=" % " onclick="Percent()">
</TD>
</TR>
<TR>
<TD>
<input name="btnFour" type="Button" value=" 4 " onclick="NumPressed(4)">
</TD>
<TD>
<input name="btnFive" type="Button" value=" 5 " onclick="NumPressed(5)">
</TD>
<TD>
<input name="btnSix" type="Button" value=" 6 " onclick="NumPressed(6)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnPlus" type="Button" value=" + " onclick="Operation('+')">
</TD>
<TD align=middle><input name="btnMinus" type="Button" value=" - " onclick="Operation('-')">
</TD>
</TR>
<TR>
<TD>
<input name="btnOne" type="Button" value=" 1 " onclick="NumPressed(1)">
</TD>
<TD>
<input name="btnTwo" type="Button" value=" 2 " onclick="NumPressed(2)">
</TD>
<TD>
<input name="btnThree" type="Button" value=" 3 " onclick="NumPressed(3)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnMultiply" type="Button" value=" * " onclick="Operation('*')">
</TD>
<TD align=middle><input name="btnDivide" type="Button" value=" / " onclick="Operation('/')">
</TD>
</TR>
<TR>
<TD>
<input name="btnZero" type="Button" value=" 0 " onclick="NumPressed(0)">
</TD>
<TD>
<input name="btnDecimal" type="Button" value=" . " onclick="Decimal()">
</TD>
<TD colspan=3>
</TD>
<TD>
<input name="btnEquals" type="Button" value=" = " onclick="Operation('=')">
</TD>
</TR>
</TABLE>
</TABLE>
</B>
</FORM>
</CENTER>
<font face="Verdana, Arial, Helvetica" size=2>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var FKeyPad = document.Keypad;
var Accum = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num) {
if (FlagNewNum) {
FKeyPad.ReadOut.value = Num;
FlagNewNum = false;
}
else {
if (FKeyPad.ReadOut.value == "0")
FKeyPad.ReadOut.value = Num;
else
FKeyPad.ReadOut.value += Num;
}
}
function Operation (Op) {
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accum += parseFloat(Readout);
else if ( '-' == PendingOp )
Accum -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accum /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accum *= parseFloat(Readout);
else
Accum = parseFloat(Readout);
FKeyPad.ReadOut.value = Accum;
PendingOp = Op;
}
}
function Decimal () {
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum) {
curReadOut = "0.";
FlagNewNum = false;
}
else
{
if (curReadOut.indexOf(".") == -1)
curReadOut += ".";
}
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry () {
FKeyPad.ReadOut.value = "0";
FlagNewNum = true;
}
function Clear () {
Accum = 0;
PendingOp = "";
ClearEntry();
}
function Neg () {
FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;
}
function Percent () {
FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accum);
}
// End -->
</SCRIPT>
</html>
با این اسکریپ کاربر مشخصات خود را در یک صفحه وارد میکنه و این مشخصات از طریق ایمیل به شما ارسال میشود
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function resetform() {
document.forms[0].elements[1]=="";
}
function submitForms() {
if (isEmail() && isFname() && isLname() && isAddress() && isCity() && isState() && isZip())
if (confirm("
You are about to e-mail your submission.
YES to submit. NO to abort."))
{
alert("
Your submission will now be sent.
Use the Return Button once the submission is complete to return to my home page.
Thank you for joining our mailing list!");
return true;
}
else
{
alert("
You have chosen to abort the submission.");
return false
}
else
return false;
}
function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("
The E-Mail field is blank.
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 ("
The E-Mail field requires a "@" and a "."be used.
Please 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 ("
The First Name field is blank.
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 ("
The Last Name field is blank.
Please enter your last name.")
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isAddress() {
if (document.forms[0].elements[4].value == "") {
alert ("
The Address field is blank.
Please enter your address.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isCity()
{
if (document.forms[0].elements[5].value == "")
{
alert ("
The City field is blank.
Please enter your city.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isState() {
if (document.forms[0].elements[6].value == "") {
alert ("
The state field is blank.
Please enter your state.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isZip() {
if (document.forms[0].elements[7].value == "") {
alert ("
The Zip code field is blank.
Please 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:manisman_3@yahoo.com?subject=TJS - Mailing List' onSubmit="return submitForms()">
<TABLE border=3 width=430 cellpadding=10><TD align="center" bgcolor="#3333FF">
<strong>
<font color="#9999FF" size=+2 face="arial">Join the Mailing List!</font><font color="#FF66CC" size=+2 face="arial"> APTECH</font></strong>
</TABLE>
<input type="hidden" name="Form" value="Submit Sub">
<TABLE border=3 cellspacing=0 cellpadding=2 bgcolor="#C0C0C0">
<tr valign=baseline>
<TD bgcolor="#99CCFF">
<font face="arial">Email Address:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="Email Address" size=35,1 maxlength=80>
</TD>
</tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">First Name:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="First Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">Last Name:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="Last Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">Address:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="Address" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">City:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="City" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">State:</font></TD>
<TD bgcolor="#99CCFF">
<input type=text name="State" size=10,1 maxlength=25>
</TD></tr>
<tr>
<TD bgcolor="#99CCFF">
<font face="arial">Zip Code:</font></TD>
<TD bgcolor="#99CCFF">
<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>
</html>