تبليغاتX
میهن پرست

میهن پرست

مطالب این وبلاگ فقط برای کسانی است که میدانند نمیدانند

(Internet Explorer only) When the form is submitted, any submit and reset buttons are disabled. This

<!-- TWO STEPS TO INSTALL DISABLE SUBMIT:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Web Site: http://dynamicdrive.com -->

<! >
<! >

<!-- Begin
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
setTimeout('alert("Your form has been submitted. Notice how the submit and reset buttons were disabled upon submission.")', 2000);
return true;
}
else {
alert("The form has been submitted. But, since you're not using IE 4+ or NS 6, the submit button was not disabled on form submission.");
return false;
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form onSubmit="return disableForm(this);">
Name: <input type=text name=person>
<input type=submit><input type=reset>
</form>
</center>



<!-- Script Size: 1.33 KB -->
+ نوشته شده در  2006/9/4ساعت 15:43  توسط حسين زارعي  | 

Allows the user to enter a number with up to 2 decimal places in a text box. In other words, 99 is o

<!-- TWO STEPS TO INSTALL DECIMALS ALLOWED:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore, Editor -->

<! >
<! >

<!-- Begin
function checkDecimals(fieldName, fieldValue) {

decallowed = 2; // how many decimals are allowed?

if (isNaN(fieldValue) || fieldValue == "") {
alert("Oops! That does not appear to be a valid number. Please try again.");
fieldName.select();
fieldName.focus();
}
else {
if (fieldValue.indexOf('.') == -1) fieldValue += ".";
dectext = fieldValue.substring(fieldValue.indexOf('.')+1, fieldValue.length);

if (dectext.length > decallowed)
{
alert ("Oops! Please enter a number with up to " + decallowed + " decimal places. Please try again.");
fieldName.select();
fieldName.focus();
}
else {
alert ("That number validated successfully.");
}
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form>
Please enter a number with up to 2 decimal places: <br>
<input type=text name=numbox>
<input type=button name=ok value="Ok" onClick="checkDecimals(this.form.numbox, this.form.numbox.value)">
</form>
</center>

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

<!-- Script Size: 1.42 KB -->
+ نوشته شده در  2006/9/4ساعت 15:43  توسط حسين زارعي  | 

Do you need your visitors to select a day from this month? Here's an excellent way to do so - they g

<!-- ONE STEP TO INSTALL DAY MENU:

1. Add the code into the BODY of your HTML document -->

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

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
today = new Date();
thismonth = today.getMonth()+1;
thisyear = today.getYear();
thisday = today.getDate();
montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
maxdays=montharray[thismonth-1];
if (thismonth==2) {
if ((thisyear/4)!=parseInt(thisyear/4)) maxdays=28;
else maxdays=29;
}
thismonth = "" + thismonth
if (thismonth.length == 1) {
thismonth = "0" + thismonth;
}
document.write("<form>");
document.write("<select name=dates size=1>");
for (var theday = 1; theday <= maxdays; theday++) {
var theday = "" + theday;
if (theday.length == 1) {
theday = "0" + theday;
}
document.write("<option");
if (theday == thisday) document.write(" selected");
document.write(">");
document.write(thismonth + "-" + theday + "-" + thisyear);
}
document.write("</select></form>");
// End -->
</SCRIPT>



<!-- Script Size: 1.20 KB -->
+ نوشته شده در  2006/9/4ساعت 15:42  توسط حسين زارعي  | 

This script accepts a number or string and formats it like U.S. currency. Adds the dollar sign, roun

<!-- TWO STEPS TO INSTALL CURRENCY FORMAT:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site: http://www7.ewebcity.com/cyanide7 -->

<! >
<! >

<!-- Begin
function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form name=currencyform>
Enter a number then click the button: <input type=text name=input size=10 value="1000434.23">
<input type=button value="Convert" onclick="this.form.input.value=formatCurrency(this.form.input.value);">
<br><br>
or enter a number and click another field: <input type=text name=input2 size=10 value="1000434.23" onBlur="this.value=formatCurrency(this.value);">
</form>
</center>



<!-- Script Size: 1.47 KB -->
+ نوشته شده در  2006/9/4ساعت 15:41  توسط حسين زارعي  | 

If you'd like to know where visitors to your site live, add this to your feedback forms. They just c

<!-- TWO STEPS TO INSTALL COUNTRY CHOOSER:

1. Paste the first code in the HEAD of your HTML document
2. Add the last coding to the BODY of your HTML document -->

<!-- STEP ONE: Paste the first code in the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
var africaArray = new Array("('Select country','',true,true)",
"('Ethiopia')",
"('Somalia')",
"('South Africa')",
"('Other')");
var middleeastArray = new Array("('Select country','',true,true)",
"('Egypt')",
"('Iran')",
"('Israel')",
"('Kuwait')",
"('Lebanon')",
"('Morocco')",
"('Saudi Arabia')",
"('Syria')",
"('Turkey')",
"('U. A. Emirates')",
"('Other')");
var asiaArray = new Array("('Select country','',true,true)",
"('Armenia')",
"('Bangladesh')",
"('Cambodia')",
"('China')",
"('India')",
"('Indonesia')",
"('Japan')",
"('Malaysia')",
"('Myanmar')",
"('Nepal')",
"('Pakistan')",
"('Philippines')",
"('Singapore')",
"('South Korea')",
"('Sri Lanka')",
"('Taiwan')",
"('Thailand')",
"('Uzbekistan')",
"('Vietnam')",
"('Other')");
var europeArray = new Array("('Select country','',true,true)",
"('Albania')",
"('Austria')",
"('Belarus')",
"('Belgium')",
"('Bosnia')",
"('Bulgaria')",
"('Croatia')",
"('Cyprus')",
"('Czech Rep.')",
"('Denmark')",
"('Estonia')",
"('Finland')",
"('France')",
"('Germany')",
"('Greece')",
"('Hungary')",
"('Iceland')",
"('Ireland')",
"('Italy')",
"('Latvia')",
"('Liechtenstein')",
"('Lithuania')",
"('Luxembourg')",
"('Macedonia')",
"('Malta')",
"('Monaco')",
"('Netherlands')",
"('Norway')",
"('Poland')",
"('Portugal')",
"('Romania')",
"('Russia')",
"('Slovakia')",
"('Slovenia')",
"('Spain')",
"('Sweden')",
"('Switzerland')",
"('Ukraine')",
"('United Kingdom')",
"('Other')");
var australiaArray = new Array("('Select country','',true,true)",
"('Australia')",
"('New Zealand')",
"('Other')");
var lamericaArray = new Array("('Select country','',true,true)",
"('Costa Rica')",
"('Cuba')",
"('El Salvador')",
"('Guatemala')",
"('Haiti')",
"('Jamaica')",
"('Mexico')",
"('Panama')",
"('Other')");
var namericaArray = new Array("('Select country','',true,true)",
"('Canada')",
"('USA')",
"('Other')");
var samericaArray = new Array("('Select country','',true,true)",
"('Argentina')",
"('Bolivia')",
"('Brazil')",
"('Chile')",
"('Colombia')",
"('Ecuador')",
"('Paraguay')",
"('Peru')",
"('Suriname')",
"('Uruguay')",
"('Venezuela')",
"('Other')");
function populateCountry(inForm,selected) {
var selectedArray = eval(selected + "Array");
while (selectedArray.length < inForm.country.options.length) {
inForm.country.options[(inForm.country.options.length - 1)] = null;
}
for (var i=0; i < selectedArray.length; i++) {
eval("inForm.country.options[i]=" + "new Option" + selectedArray[i]);
}
if (inForm.region.options[0].value == '') {
inForm.region.options[0]= null;
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0);
}
else {
if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
window.history.go(0);
}
}
}
}
}
function populateUSstate(inForm,selected) {
var stateArray = new Array("('Select State','',true,true)",
"('Alabama')",
"('Alaska')",
"('Arizona')",
"('Arkansas')",
"('California')",
"('Colorado')",
"('Connecticut')",
"('Delaware')",
"('Columbia')",
"('Florida')",
"('Georgia')",
"('Hawaii')",
"('Idaho')",
"('Illinois')",
"('Indiana')",
"('Iowa')",
"('Kansas')",
"('Kentucky')",
"('Louisiana')",
"('Maine')",
"('Maryland')",
"('Massachusetts')",
"('Michigan')",
"('Minnesota')",
"('Mississippi')",
"('Missouri')",
"('Montana')",
"('Nebraska')",
"('Nevada')",
"('New Hampshire')",
"('New Jersey')",
"('New Mexico')",
"('New York')",
"('North Carolina')",
"('North Dakota')",
"('Ohio')",
"('Oklahoma')",
"('Oregon')",
"('Pennsylvania')",
"('Rhode Island')",
"('South Carolina')",
"('South Dakota')",
"('Tennessee')",
"('Texas')",
"('Utah')",
"('Vermont')",
"('Virginia')",
"('Washington')",
"('West Virginia')",
"('Wisconsin')",
"('Wyoming')");
if (selected == 'USA') {
for (var i=0; i < stateArray.length; i++) {
eval("inForm.country.options[i]=" + "new Option" + stateArray[i]);
}
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0)
}
else {
if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
window.history.go(0)
}
}
}
}
else {
}
if (selected == 'Other') {
newCountry = "";
while (newCountry == ""){
newCountry=prompt ("Please enter the name of your country.", "");
}
if (newCountry != null) {
inForm.country.options[(inForm.country.options.length-1)]=new Option(newCountry,newCountry,true,true);
inForm.country.options[inForm.country.options.length]=new Option('Other, not listed','Other');
}
}
if(inForm.country.options[0].text == 'Select country') {
inForm.country.options[0]= null;
}
}
// End -->
</script>

<!-- STEP TWO: Add the last coding to the BODY of your HTML document -->

<BODY>

<center>
<form name="globe">
<select name="region" onChange="populateCountry(document.globe,document.globe.region.options[document.globe.region.selectedIndex].value)">
<option selected value=''>Select Region</option>
<option value='asia'>Asia</option>
<option value='africa'>Africa</option>
<option value='australia'>Australia</option>
<option value='europe'>Europe</option>
<option value='middleeast'>Middle East</option>
<option value='lamerica'>Latin America</option>
<option value='namerica'>North America</option>
<option value='samerica'>South America</option>
</select>
<select name="country" onChange="populateUSstate(document.globe,document.globe.country.options[document.globe.country.selectedIndex].text)">
<option value=''><--------------------</option>
</select>
</form>
</center>



<!-- Script Size: 6.08 KB -->
+ نوشته شده در  2006/9/4ساعت 15:40  توسط حسين زارعي  | 

Allows the user to enter their name in the first field and have copies it to the second field for us

<!-- ONE STEP TO INSTALL COPY NAME:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<center>
<pre>
<form name=userform>
Name: <input type=text name=name size=15 value="" onChange="this.form.userid.value=this.value;"><br>
User ID: <input type=text name=userid size=15 value="" onChange="this.value=this.form.name.value;">
<p>
<input type=button name=action value="Done!">
</form>
</pre>
</center>



<!-- Script Size: 0.53 KB -->
+ نوشته شده در  2006/9/4ساعت 15:40  توسط حسين زارعي  | 

Allows the user to click a checkbox on a form to duplicate information. For example, they can copy t

<!-- TWO STEPS TO INSTALL COPY FIELDS:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
var ShipFirst = "";
var ShipLast = "";
var ShipEmail = "";
var ShipCompany = "";
var ShipAddress1 = "";
var ShipAddress2 = "";
var ShipCity = "";
var ShipState = "";
var ShipStateIndex = 0;
var ShipZip = "";
var ShipConfirm = 0;

function InitSaveVariables(form) {
ShipFirst = form.ShipFirst.value;
ShipLast = form.ShipLast.value;
ShipEmail = form.ShipEmail.value;
ShipCompany = form.ShipCompany.value;
ShipAddress1 = form.ShipAddress1.value;
ShipAddress2 = form.ShipAddress2.value;
ShipCity = form.ShipCity.value;
ShipZip = form.ShipZip.value;
ShipStateIndex = form.ShipState.selectedIndex;
ShipState = form.ShipState[ShipStateIndex].value;
ShipConfirm = form.ShipConfirm.checked;
}

function ShipToBillPerson(form) {
if (form.copy.checked) {
InitSaveVariables(form);
form.ShipFirst.value = form.BillFirst.value;
form.ShipLast.value = form.BillLast.value;
form.ShipEmail.value = form.BillEmail.value;
form.ShipCompany.value = form.BillCompany.value;
form.ShipAddress1.value = form.BillAddress1.value;
form.ShipAddress2.value = form.BillAddress2.value;
form.ShipCity.value = form.BillCity.value;
form.ShipZip.value = form.BillZip.value;
form.ShipState.selectedIndex = form.BillState.selectedIndex;
form.ShipConfirm.checked = form.BillConfirm.checked;
}
else {
form.ShipFirst.value = ShipFirst;
form.ShipLast.value = ShipLast;
form.ShipEmail.value = ShipEmail;
form.ShipCompany.value = ShipCompany;
form.ShipAddress1.value = ShipAddress1;
form.ShipAddress2.value = ShipAddress2;
form.ShipCity.value = ShipCity;
form.ShipZip.value = ShipZip;
form.ShipState.selectedIndex = ShipStateIndex;
form.ShipConfirm.checked = ShipConfirm;
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form method="post" action="http://www.your-web-site-address-here.com/script.cgi" name="billform">
<table border="1" cellspacing="0" cellpadding="3" width="400">

<tr bgcolor="#003399">
<td colspan=2 width="100%" bgcolor="#003399">
<b><font color=white size="-1" face="arial, helvetica">Billing Information</font></b>
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">First Name:</font>
</td>
<td>
<input type="text" size="15" maxlength="50" name="BillFirst">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Last Name:</font>
</td>
<td>
<input type="text" size="15" maxlength="50" name="BillLast">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">E-Mail:</font>
</td>
<td>
<input type="text" size="15" name="BillEmail">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Company:</font>
</td>
<td>
<input type="text" size="25" maxlength="100" name="BillCompany">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Address:</font>
</td>
<td>
<input type="text" size="40" maxlength="35" name="BillAddress1">
</td>
</tr>
<tr>
<td>

</td>
<td>
<input type="text" size="40" maxlength="35" name="BillAddress2">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">City:</font>
</td>
<td>
<input type="text" size="25" maxlength="21" name="BillCity">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">State:</font>
</td>
<td>
<select name="BillState">
<option selected>
<option value="AL">ALABAMA
<option value="AK">ALASKA
<option value="AZ">ARIZONA
<option value="AR">ARKANSAS
<option value="CA">CALIFORNIA
<option value="CO">COLORADO
<option value="CT">CONNECTICUT
<option value="DE">DELAWARE
<option value="FL">FLORIDA
<option value="GA">GEORGIA
<option value="HI">HAWAII
<option value="ID">IDAHO
<option value="IL">ILLINOIS
<option value="IN">INDIANA
<option value="IA">IOWA
<option value="KS">KANSAS
<option value="KY">KENTUCKY
<option value="LA">LOUISIANA
<option value="ME">MAINE
<option value="MD">MARYLAND
<option value="MA">MASSACHUSETTS
<option value="MI">MICHIGAN
<option value="MN">MINNESOTA
<option value="MS">MISSISSIPPI
<option value="MO">MISSOURI
<option value="MT">MONTANA
<option value="NE">NEBRASKA
<option value="NV">NEVADA
<option value="NH">NEW HAMPSHIRE
<option value="NJ">NEW JERSEY
<option value="NM">NEW MEXICO
<option value="NY">NEW YORK
<option value="NC">NORTH CAROLINA
<option value="ND">NORTH DAKOTA
<option value="OH">OHIO
<option value="OK">OKLAHOMA
<option value="OR">OREGON
<option value="PA">PENNSYLVANIA
<option value="RI">RHODE ISLAND
<option value="SC">SOUTH CAROLINA
<option value="SD">SOUTH DAKOTA
<option value="TN">TENNESSEE
<option value="TX">TEXAS
<option value="UT">UTAH
<option value="VT">VERMONT
<option value="VA">VIRGINIA
<option value="WA">WASHINGTON
<option value="DC">WASHINGTON, D.C.
<option value="WV">WEST VIRGINIA
<option value="WI">WISCONSIN
<option value="WY">WYOMING
</select>

<input type="text" size="10" maxlength="10" name="BillZip">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="checkbox" name="BillConfirm" selected> <font face="arial, helvetica" size="-2">Send confirmation email via email</font>
</td>
</tr>


<tr bgcolor="#003399">
<td colspan=2 width="100%" bgcolor="#003399">
<b><font color=white size="-1" face="arial, helvetica">Shipping Information</font></b>
<font color=white size="-2" face="arial, helvetica">
(Check to use Billing Information: <input type="checkbox" name="copy"
OnClick="javascript:ShipToBillPerson(this.form);" value="checkbox"> )
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">First Name:</font></td>
<td>
<input type="text" size="15" maxlength="50" name="ShipFirst">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Last Name:</font>
</td>
<td>
<input type="text" size="15" maxlength="50" name="ShipLast">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">E-Mail:</font>
</td>
<td>
<input type="text" size="15" name="ShipEmail">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Company:</font>
</td>
<td>
<input type="text" size="25" maxlength="100" name="ShipCompany">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">Address:</font>
</td>
<td>
<input type="text" size="40" maxlength="35" name="ShipAddress1">
</td>
</tr>
<tr>
<td>

</td>
<td>
<input type="text" size="40" maxlength="35" name="ShipAddress2">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">City:</font>
</td>
<td>
<input type="text" size="25" maxlength="21" name="ShipCity">
</td>
</tr>
<tr>
<td>
<font size="-1" face="arial, helvetica">State:</font>
</td>
<td>
<select name="ShipState">
<option selected>
<option value="AL">ALABAMA
<option value="AK">ALASKA
<option value="AZ">ARIZONA
<option value="AR">ARKANSAS
<option value="CA">CALIFORNIA
<option value="CO">COLORADO
<option value="CT">CONNECTICUT
<option value="DE">DELAWARE
<option value="FL">FLORIDA
<option value="GA">GEORGIA
<option value="HI">HAWAII
<option value="ID">IDAHO
<option value="IL">ILLINOIS
<option value="IN">INDIANA
<option value="IA">IOWA
<option value="KS">KANSAS
<option value="KY">KENTUCKY
<option value="LA">LOUISIANA
<option value="ME">MAINE
<option value="MD">MARYLAND
<option value="MA">MASSACHUSETTS
<option value="MI">MICHIGAN
<option value="MN">MINNESOTA
<option value="MS">MISSISSIPPI
<option value="MO">MISSOURI
<option value="MT">MONTANA
<option value="NE">NEBRASKA
<option value="NV">NEVADA
<option value="NH">NEW HAMPSHIRE
<option value="NJ">NEW JERSEY
<option value="NM">NEW MEXICO
<option value="NY">NEW YORK
<option value="NC">NORTH CAROLINA
<option value="ND">NORTH DAKOTA
<option value="OH">OHIO
<option value="OK">OKLAHOMA
<option value="OR">OREGON
<option value="PA">PENNSYLVANIA
<option value="RI">RHODE ISLAND
<option value="SC">SOUTH CAROLINA
<option value="SD">SOUTH DAKOTA
<option value="TN">TENNESSEE
<option value="TX">TEXAS
<option value="UT">UTAH
<option value="VT">VERMONT
<option value="VA">VIRGINIA
<option value="WA">WASHINGTON
<option value="DC">WASHINGTON, D.C.
<option value="WV">WEST VIRGINIA
<option value="WI">WISCONSIN
<option value="WY">WYOMING
</select>

<input type="text" size="10" maxlength="10" name="ShipZip">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="checkbox" name="ShipConfirm" selected> <font face="arial, helvetica" size="-2">Send confirmation email via email</font>
</td>
</tr>
</table>
</form>
</center>



<!-- Script Size: 8.75 KB -->
+ نوشته شده در  2006/9/4ساعت 15:39  توسط حسين زارعي  | 

This script allows checkboxes to check and uncheck based on the selection in another checkbox. If th

<!-- TWO STEPS TO INSTALL CONTROLLED BOXES:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Scott Waichler -->

<! >
<! >

<!-- Begin
function checkChoice(field, i) {
if (i == 0) { // "All" checkbox selected.
if (field[0].checked == true) {
for (i = 1; i < field.length; i++)
field[i].checked = false;
}
}
else { // A checkbox other than "Any" selected.
if (field[i].checked == true) {
field[0].checked = false;
}
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
Please select your favorite class(es):
<form name=pickform>
<table>
<tr><td>
<input type=checkbox name=classes value="*" onclick="checkChoice(document.pickform.classes, 0)" checked>All
<br>
<input type=checkbox name=classes value="science" onclick="checkChoice(document.pickform.classes, 1)">Science
<br>
<input type=checkbox name=classes value="math" onclick="checkChoice(document.pickform.classes, 2)">Math
<br>
<input type=checkbox name=classes value="english" onclick="checkChoice(document.pickform.classes, 3)">English
<br>
<input type=checkbox name=classes value="history" onclick="checkChoice(document.pickform.classes, 4)">Histroy
<br>
<input type=checkbox name=classes value="other" onclick="checkChoice(document.pickform.classes, 5)">Other
</td></tr>
</table>
</form>
</center>



<!-- Script Size: 1.78 KB -->
+ نوشته شده در  2006/9/4ساعت 15:38  توسط حسين زارعي  | 

Your order has been submitted. If you entered your email address, it will arrive shortly. The source

<!-- SIX STEPS TO INSTALL CONFIRMABLE ORDER FORM:

1. Create the order form code into the BODY section
2. Using the 'value' format to make entries for each item
3. Create a new 'confirm-order.html' HTML page
4. Copy the next coding into the NEXT of your HTML document
5. Paste the onLoad event handler into the BODY tag
6. Insert the final code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<!-- Create an HTML order form similar to the one below.
The confirm-order.html address is your confirm page -->

<form name=orderform action="confirm-order.html">
(Just check the items you wish to order.)<p>
<table border=1>
<tr>
<td>
<input type=checkbox name=item1A value="1A-Item_1_is_a_....*15.00$"></td>

<!-- STEP TWO: Using this format, add an entry for each sale item

Each item must have a checkbox in the format above.

The value="" is where all the magic happens
Put the Item Number then a dash (-) then the
description (with underscores for any spaces)
then a star (*) then the cost, and end with
a dollar sign ($) like this: Repeat for each
item for sale. -->

<td>1A</td>
<td>Item 1 is a ....</td>
<td>$15.00</td>
</tr>
<tr>
<td>
<input type=checkbox name=item2A value="2A-Item_2_is_a_....*15.00$"></td>
<td>2A</td>
<td>Item 2 is a ....</td>
<td>$30.00</td>
</tr>
<tr>
<td>
<input type=checkbox name=item3A value="3A-Item_3_is_a_....*45.00$"></td>
<td>3A</td>
<td>Item 3 is a ....</td>
<td>$45.00</td>
</tr>
<tr>
<td colspan=4 align=center>
<input type=submit value="Order">
</td>
</tr>
</table>
</form>

<!-- STEP THREE: Create a new 'confirm-order.html' document -->

<!-- STEP FOUR: Save this code into the HEAD of your confirm page -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
function decodeString() {
valNum = new Array();
valData = new Array();
var string, length, dataCount, orderData, grandTotal;
string = "" + unescape(location.search);
string = string.substring(1,string.length);
length = location.search.length;
orderData = "";
dataCount = 1;
for (var c = 0; c < string.length; c++)
if (string.charAt(c).indexOf("&") != -1) dataCount++;

orderData = "<table border=1 width=400>";
orderData += "<tr><td>Item</td><td>Description</td><td>Cost</td></tr>";
grandTotal = 0;
for (var i = 0; i < dataCount; i++)
{
valNum[i] = string.substring(0,string.indexOf("="));
string = string.substring(string.indexOf("=")+1,string.length);
if (i == dataCount-1) valData[i] = string;
else valData[i] = string.substring(0,string.indexOf("&"));
ampd = valData[i].indexOf("&");
pipe = valData[i].indexOf("-");
star = valData[i].indexOf("*");
line = valData[i].indexOf("$");
itemnum = string.substring(0,pipe);
itemdsc = string.substring(pipe+1,star);
itemcst = string.substring(star+1,line);
string = string.substring(ampd+1,string.length);

orderData += "<tr>";
orderData += "<input type=hidden name=item" + (i+1) + "num value='" + itemnum + "'>";
orderData += "<input type=hidden name=item" + (i+1) + "dsc value='" + itemdsc + "'>";
orderData += "<input type=hidden name=item" + (i+1) + "cst value='$" + itemcst + "'>";
orderData += "<td>" + itemnum + "</td>";
orderData += "<td>" + itemdsc + "</td>";
orderData += "<td>" + itemcst + "</td>";
orderData += "</tr>";
grandTotal += parseInt(itemcst);
}
orderData += "<tr>";
orderData += "<td colspan=2 align=center>Total</td><td>" + grandTotal + ".00</td>";
orderData += "</tr>";
orderData += "<tr>";
orderData += "<td colspan=3 align=center><input type=submit value='Confirm Order!'> or <a href='javascript:history.go(-1)'>Go Back</a></td>";
orderData += "</tr>";
orderData += "<input type=hidden name=grandtotal value='$" + grandTotal + ".00'>";
orderData += "</table>";
document.write(orderData);
}

function openThanks() {
window.open("confirm-order-thanks.html"); // Can be any "thank you" page
}
// End -->
</script>
</HEAD>

<!-- STEP FIVE: Add the onLoad event handler into the BODY tag -->

<BODY onUnload="openThanks()">

<!-- STEP SIX: Paste the last code into the BODY of confirm-order.html

<form method=post action="http://cgi.freedback.com/mail.pl" name="emailform">

<!-- Don't forget to change this to your email address! -->

<input type=hidden name=to value="you@your-web-site-address-here.com">
<input type=hidden name=subject value="** Order Form **">

<center>
<script language="JavaScript">
<!-- Begin
decodeString();
// End -->
</script>
</center>
</form>



<!-- Script Size: 4.79 KB -->
+ نوشته شده در  2006/9/4ساعت 15:38  توسط حسين زارعي  | 

Quickly add commas to any numerical form input. Great for displaying large numbers!

<!-- TWO STEPS TO INSTALL COMMAS:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mark Henwood (mark_henwood@hotmail.com) -->

<! >
<! >

<!-- Begin
function commaSplit(srcNumber) {
var txtNumber = '' + srcNumber;
if (isNaN(txtNumber) || txtNumber == "") {
alert("Oops! That does not appear to be a valid number. Please try again.");
fieldName.select();
fieldName.focus();
}
else {
var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
var arrNumber = txtNumber.split('.');
arrNumber[0] += '.';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
} while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join('');
}
else {
return arrNumber[0].split('.')[0];
}
}
}
// End -->
</script>

</HEAD>

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

<BODY>

<form name="commas">
Input a Number:
<input type=text name="inpNumber" size=20 value="">
<input type=button value="Add Commas" onClick="document.commas.inpNumber.value=commaSplit(document.commas.inpNumber.value);">
</form>



<!-- Script Size: 1.51 KB -->
+ نوشته شده در  2006/9/4ساعت 15:37  توسط حسين زارعي  | 

Keep users from typing in all caps, but still allow for capital letter strings for things like initi

<!-- TWO STEPS TO INSTALL CLEAN CAPS:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore, Editor -->
<!-- Idea by: Zachary McDermott -->

<! >
<! >

<!-- Begin
function cleanCAPS(str) {
capsallowed = 3; // Lowercase if more than ## CAPS in a row
do {
eval("re = /([A-Z]{" + (capsallowed+1) + ",})/g;");
myArray = str.match(re);
if (myArray) {
eval("re = /" + myArray[0] + "/;");
str = str.replace(re, ""+myArray[0].toLowerCase());
}
} while (myArray);
return str;
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form name=test action="your-script.cgi" onSubmit="this.comments.value=cleanCAPS(this.comments.value); return true;">
<input type=text name=comments value="HELLO THERE, my inITIALS are TJM, and I LOVE the EMP." size=60>
<input type=submit value="Submit">
</form>
</center>



<!-- Script Size: 1.24 KB -->
+ نوشته شده در  2006/9/4ساعت 15:36  توسط حسين زارعي  | 

Prevents the user from selecting a filename with a space (known to cause problems with some CGI-scri

<!-- TWO STEPS TO INSTALL CHECK ENTRY:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
function validate(){
var invalid = " "; // Invalid character is a space

if (document.submitform.filename.value.indexOf(invalid) > -1) {
alert("Sorry, spaces are not allowed.");
return false;
}
else {
return true;
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form name=submitform onSubmit="return validate()">
<input type=file name=filename>
<p>
<input type=submit value="Submit">
</form>
</center>



<!-- Script Size: 0.95 KB -->
+ نوشته شده در  2006/9/4ساعت 15:36  توسط حسين زارعي  | 

This is an e-mail address validation function. It allows the usual user@domain syntax, but in additi

<!-- TWO STEPS TO INSTALL EMAIL ADDRESS VALIDATION:

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

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

<HEAD>

<SCRIPT LANGUAGE="Javascript">
<!-- Changes: Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

/* 1.1.2: Fixed a bug where trailing . in e-mail address was passing
(the bug is actually in the weak regexp engine of the browser; I
simplified the regexps to make it work).
1.1.1: Removed restriction that countries must be preceded by a domain,
so abc@host.uk is now legal. However, there's still the
restriction that an address must end in a two or three letter
word.
1.1: Rewrote most of the function to conform more closely to RFC 822.
1.0: Original */

<! >
<! >

<!-- Begin
function emailCheck (emailStr) {
/* The following pattern is used to check if the entered e-mail address
fits the user@domain format. It also is used to separate the username
from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
characters. We don't want to allow special characters in the address.
These characters include ( ) < > @ , ; : \ " . [ ] */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a
username or domainname. It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes). E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
rather than symbolic names. E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */
alert("Email address seems incorrect (check @ and .'s)")
return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid
if (user.match(userPat)==null) {
// user is not valid
alert("The username doesn't seem to be valid.")
return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
// this is an IP address
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!")
return false
}
}
return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
alert("The domain name doesn't seem to be valid.")
return false
}

/* domain name seems valid, but now make sure that it ends in a
three-letter word (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding
the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 ||
domArr[domArr.length-1].length>3) {
// the address must end in a two letter or three letter word.
alert("The address must end in a three-letter domain, or two letter country.")
return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
var errStr="This address is missing a hostname!"
alert(errStr)
return false
}

// If we've gotten this far, everything's valid!
return true;
}
// End -->
</script>
</head>

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

<BODY>

<center>
<form name=emailform onSubmit="return emailCheck(this.email.value);">
Your Email Address: <input type=text name="email"><br>
<input type=submit value="Submit">
</form>
</center>



<!-- Script Size: 6.03 KB -->
+ نوشته شده در  2006/9/4ساعت 15:35  توسط حسين زارعي  | 

Easily count the number of checkboxes that have been selected. Easy!

<!-- TWO STEPS TO INSTALL CHECKBOX COUNTER:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Alan Gruskoff (alan@performantsystems.com) -->
<!-- Web Site: http://www.performantsystems.com/ -->

<! >
<! >

<!-- Begin
function anyCheck(form) {
var total = 0;
var max = form.ckbox.length;
for (var idx = 0; idx < max; idx++) {
if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
total += 1;
}
}
alert("You selected " + total + " boxes.");
}
// End -->
</script>

</HEAD>
+ نوشته شده در  2006/9/4ساعت 15:34  توسط حسين زارعي  | 

Takes a series of known named checkboxes and checks or uncheck them all at once. It can even change

<!-- TWO STEPS TO INSTALL CHECKBOX CHANGER:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
function checkAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == false) box.checked = true;
}
}

function uncheckAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == true) box.checked = false;
}
}

function switchAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
box.checked = !box.checked;
}
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form name=checkboxform>
<input type=checkbox name=C1 checked>C1<br>
<input type=checkbox name=C2 checked>C2<br>
<input type=checkbox name=C3 checked>C3<br>
<input type=checkbox name=C4 checked>C4<br>
<input type=checkbox name=C5 checked>C5<br>
<input type=checkbox name=C6 checked>C6<br>
<input type=checkbox name=C7 checked>C7<br>
<input type=checkbox name=C8 checked>C8<br>
<input type=checkbox name=C9 checked>C9<br>
<input type=checkbox name=C10 checked>C10<br>
<input type=checkbox name=C11 checked>C11<br>
<input type=checkbox name=C12 checked>C12<br>
<input type=checkbox name=C13 checked>C13<br>
<input type=checkbox name=C14 checked>C14<br>
<br>
<input type=button value="Check All" onClick="checkAll()"><br>
<input type=button value="Uncheck All" onClick="uncheckAll()"><br>
<input type=button value="Switch All" onClick="switchAll()"><br>
</form>
</center>



<!-- Script Size: 1.94 KB -->
+ نوشته شده در  2006/9/4ساعت 15:33  توسط حسين زارعي  | 

(Internet Explorer Only) Using the OnKeypress event, you can trap and prevent certain characters (re

<!-- ONE STEP TO INSTALL BLOCK KEY PRESS:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<!-- Script by: Jeremy Wollard (wollard@flash.net) -->

<center>
<form onSubmit="return false;">
This field will not accept special characters: (like !@#$%^&* etc)<br>
<textarea rows=2 cols=20 name=comments onKeypress="if ((event.keyCode > 32 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 65) || (event.keyCode > 90 && event.keyCode < 97)) event.returnValue = false;"></textarea>
<br>
<br>
This field will not accept double or single quotes:<br>
<input type=text name=txtEmail onKeypress="if (event.keyCode==34 || event.keyCode==39) event.returnValue = false;">
<br>
<br>
This field will only accept numbers:<br>
<input type=text name=txtPostalCode onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
</form>
</center>



<!-- Script Size: 0.99 KB -->
+ نوشته شده در  2006/9/4ساعت 15:32  توسط حسين زارعي  | 

The simplest way to require visitors to fill out certain fields is to us this script - just add the

<!-- TWO STEPS TO INSTALL BASIC VALIDATION:

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

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

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: wsabstract.com -->

<! >
<! >

<!-- Begin
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field was properly completed.");
return false;
}
else
return true;
}
// End -->
</script>

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

<center>
<form onSubmit="return checkrequired(this)">

<input type="text" name="requiredname">
<br>
<input type="text" name="requiredemail">
<br>
<select name="requiredhobby">
<option selected>Pick an option!
<option>1
<option>2
<option>3
</select>
<br>
<textarea name="requiredcomments"></textarea>
<br>
<input type=submit value="Submit">
</form>
</center>

<!-- The first option in your pulldown menus must be set to 'selected' !! -->



<!-- Script Size: 1.41 KB -->
+ نوشته شده در  2006/9/4ساعت 15:31  توسط حسين زارعي  | 

This pulldown menu will automatically adjust the range of years depending on the current year. As an


<!-- ONE STEP TO INSTALL AUTO YEAR:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Don Demrow (d1102@home.com) -->
<!-- Web Site: http://resume.w3site.com -->

<! >
<! >

<!-- Begin
var time = new Date();
var year = time.getYear();
if (year < 1900) {
year = year + 1900;
}
var date = year - 101; /*change the '101' to the number of years in the past you want to show */
var future = year + 100; /*change the '100' to the number of years in the future you want to show */
document.writeln ("<FORM><SELECT><OPTION value=\"\">Year");
do {
date++;
document.write ("<OPTION value=\"" +date+"\">" +date+ "");
}
while (date < future)
document.write ("</SELECT></FORM>");
// End -->
</script>



<!-- Script Size: 1.09 KB -->
+ نوشته شده در  2006/9/4ساعت 15:30  توسط حسين زارعي  | 

Automatically sets focus to the next form element when the current form element's maxlength has been

<!-- TWO STEPS TO INSTALL AUTO TAB:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site: http://members.xoom.com/cyanide_7 -->

<! >
<! >

<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode;
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form>
<table>
<tr>
<td>Phone Number : <br>
1 - (
<small><input onKeyUp="return autoTab(this, 3, event);" size="4" maxlength="3"></small>) -
<small><input onKeyUp="return autoTab(this, 3, event);" size="4" maxlength="3"></small> -
<small><input onKeyUp="return autoTab(this, 4, event);" size="5" maxlength="4"></small>
</td>
</tr>
<tr>
<td>Social Security Number : <br>
<small><input onKeyUp="return autoTab(this, 3, event);" size="4" maxlength="3"></small> -
<small><input onKeyUp="return autoTab(this, 2, event);" size="3" maxlength="2"></small> -
<small><input onKeyUp="return autoTab(this, 4, event);" size="5" maxlength="4"></small>
</td>
</tr>
</table>
</form>
</center>



<!-- Script Size: 1.68 KB -->
+ نوشته شده در  2006/9/4ساعت 15:29  توسط حسين زارعي  | 

This pulldown menu will automatically adjust the range of months so that the current month is at the

<!-- ONE STEP TO INSTALL AUTO MONTH:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Don Demrow (d1102@home.com) -->
<!-- Modified: Benjamin Wright, JavaScript Source Editor -->
<!-- Web Site: http://resume.w3site.com -->

<! >
<! >

<!-- Begin
var time = new Date();
var month = time.getMonth();
var date = month - 12;
var realJavaScriptMonth = month;
var future = month + 0;
month = month + 1; /* Compensate for "January" being "0" */
document.writeln ("<FORM><SELECT><OPTION value=\"\">Month");
do {
month = date;
if (month >= 12) {
month = month - 12;
}
if (month < 0) {
month = month + 12;
}
date++;
var dateName ="";
switch (month) {
case 0:
dateName = "January";
break;
case 1:
dateName = "February";
break;
case 2:
dateName = "March";
break;
case 3:
dateName = "April";
break;
case 4:
dateName = "May";
break;
case 5:
dateName = "June";
break;
case 6:
dateName = "July";
break;
case 7:
dateName = "August";
break;
case 8:
dateName = "September";
break;
case 9:
dateName = "October";
break;
case 10:
dateName = "November";
break;
case 11:
dateName = "December";
break
}
month++;
realJavaScriptMonth++;
document.write ("<OPTION value=\"" + realJavaScriptMonth + "\">" + dateName + "");
realJavaScriptMonth++;
}
while (date < future)
document.write ("</SELECT></FORM>");
// End -->
</script>



<!-- Script Size: 1.74 KB -->
+ نوشته شده در  2006/9/4ساعت 15:28  توسط حسين زارعي  | 

Automatically opens a new e-mail using your default e-mail client and fills in the subject line and

<!-- TWO STEPS TO INSTALL AUTO EMAIL LINK:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: CodeLifter.com (support@codelifter.com) -->
<!-- Web Site: http://www.codelifter.com -->

<! >
<! >

<!-- Begin
var good;
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail) {
good = true;
}
else {
alert('Please enter a valid e-mail address.');
field.focus();
field.select();
good = false;
}
}
u = window.location;
m = "I thought this might interest you...";
function mailThisUrl() {
good = false
checkEmailAddress(document.eMailer.address);
if (good) {
// the following expression must be all on one line...
window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u;
}
}
// End -->
</script>

</HEAD>

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

<BODY>

<form name="eMailer">
E-MAIL THIS LINK
<br>
Enter recipient's e-mail:
<br>
<input type="text" name="address" size="25">
<br>
<input type="button" value="Send this URL" onClick="mailThisUrl();">
</form>



<!-- Script Size: 1.69 KB -->
+ نوشته شده در  2006/9/4ساعت 15:27  توسط حسين زارعي  | 

This is a neat little JavaScript button that will help you to e-mail anyone. Just click 'E-Mail Some

<!-- TWO STEPS TO INSTALL ANYWHERE MAIL:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin
function mailsome1(){
who=prompt("Enter recipient's email address: ","antispammer@earthling.net");
what=prompt("Enter the subject: ","none");
if (confirm("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true){
parent.location.href='mailto:'+who+'?subject='+what+'';
}
}
// End -->
</SCRIPT>

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

<BODY>

<CENTER>
<a href='javascript:mailsome1()'>E-Mail Someone!</a>
<FORM>
<input type=button value="E-Mail Someone!" onClick="mailsome1()">
</FORM>
</CENTER>



<!-- Script Size: 1.02 KB -->
+ نوشته شده در  2006/9/4ساعت 15:26  توسط حسين زارعي  | 

Converts a textbox entry to all capital letters as soon as they move to the next item in the form (o


<!-- ONE STEP TO INSTALL ALL UPPER CASE:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<! >
<! >

<center>
<form name="capsform">
<input type="text" name="caps" size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();">
<br>
<input type="button" value="Ok!">
</form>
</center>



<!-- Script Size: 0.55 KB -->
+ نوشته شده در  2006/9/4ساعت 15:25  توسط حسين زارعي  | 

Converts a textbox entry to all lowercase letters as soon as they move to the next item in the form

<!-- ONE STEP TO INSTALL ALL LOWER CASE:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<! >
<! >

<center>
<form name="capsform">
<input type="text" name="caps" size=40 value="" onChange="javascript:this.value=this.value.toLowerCase();">
<br>
<input type="button" value="Ok!">
</form>
</center>



<!-- Script Size: 0.55 KB -->
+ نوشته شده در  2006/9/4ساعت 15:25  توسط حسين زارعي  | 

JavaScript will only let you enter your name in this form if you indicate you agree to the terms by

<!-- TWO STEPS TO INSTALL AGREE BEFORE ENTRY:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<! >
<! >

<!-- Begin

agree = 0; // 0 means 'no', 1 means 'yes'

// End -->
</script>
</HEAD>

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

<BODY>

<center>
<form name=enableform>
You can only enter your name if you agree to the terms. (just a demo)<br>
<br>
<input type=radio name='enable' value='agree' onClick="agree=1; document.enableform.box.focus();">I agree<br>
<input type=radio name='enable' value='disagree' onClick="agree=0; document.enableform.box.value='';">I disagree<br>

Please enter your name:

<input type=text name=box onFocus="if (!agree)this.blur();" onChange="if (!agree)this.value='';" size=12>
<br>
<br>
<input type=submit value="Done!">
</form>
</center>



<!-- Script Size: 1.12 KB -->
+ نوشته شده در  2006/9/4ساعت 15:24  توسط حسين زارعي  | 

Displays the date the current week starts on. Useful if you want a new link each week or just to sho

<!-- TWO STEPS TO INSTALL CURRENT WEEK:

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

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

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mark McCain (sub235k@worldnet.att.net) -->

<! >
<! >

<!-- Begin
page_extension = ".html";
var today = new Date();
var day = today.getDate();
var month = today.getMonth() + 1;
var year = today.getYear();
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
var offset = today.getDay();
var week;

if(offset != 0) {
day = day - offset;
if ( day < 1) {
if ( month == 1) day = 31 + day;
if (month == 2) day = 31 + day;
if (month == 3) {
if (( year == 00) || ( year == 04)) {
day = 29 + day;
}
else {
day = 28 + day;
}
}
if (month == 4) day = 31 + day;
if (month == 5) day = 30 + day;
if (month == 6) day = 31 + day;
if (month == 7) day = 30 + day;
if (month == 8) day = 31 + day;
if (month == 9) day = 31 + day;
if (month == 10) day = 30 + day;
if (month == 11) day = 31 + day;
if (month == 12) day = 30 + day;
if (month == 1) {
month = 12;
year = year - 1;
}
else {
month = month - 1;
}
}
}

week = month + "-" + day + "-" + year; // i.e. 10-31-99
page = week + page_extension; // i.e. 10-31.99.html

link = "<a href='" + page + "'>Page of the Week</a>"; // link to 10-31-99.html
// End -->
</script>
</HEAD>

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

<BODY>

<script>
document.write(link);

// or you can use
// document.write(week)
// or
// document.write(page)

</script>



<!-- Script Size: 1.75 KB -->
+ نوشته شده در  2006/9/4ساعت 15:23  توسط حسين زارعي  | 

Use JavaScript to put the current time on your page. It even follows the time in A.M. and P.M.! A ni

<!-- THREE STEPS TO INSTALL CURRENT TIME:

1. Paste the specified coding into the HEAD of your HTML document
2. Add the onLoad event handler to the BODY tag
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">

<! >
<! >

<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
// End -->
</SCRIPT>

<!-- STEP TWO: Add this onLoad event handler to the BODY tag -->

<BODY onLoad="startclock()">

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

<CENTER>
<FORM name="clock">
<input type="text" name="face" size=13 value="">
</FORM>
</CENTER>



<!-- Script Size: 1.45 KB -->
+ نوشته شده در  2006/9/4ساعت 15:23  توسط حسين زارعي  | 

Use this script to write the current date to your web page. Looks very professional. Another very ne

<!-- ONE STEP TO INSTALL CURRENT DATE:

1. Put the code into the BODY of your HTML document -->

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

<BODY>

<SCRIPT LANGUAGE="JavaScript1.2">

<! >
<! >

<!-- Begin
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
document.write("<center>" + lmonth + " ");
document.write(date + ", " + year + "</center>");
// End -->
</SCRIPT>
</CENTER>



<!-- Script Size: 1.00 KB -->
+ نوشته شده در  2006/9/4ساعت 15:22  توسط حسين زارعي  | 

Here, you can use stopwatch functions to count up and down - separately or together at once. Try it

<!-- TWO STEPS TO INSTALL COUNT UP & DOWN:

1. Paste the specified 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">

<! >
<! >

<!-- Begin
var up,down;var min1,sec1;var cmin1,csec1,cmin2,csec2;
function Minutes(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break;
return(data.substring(0,i));
}
function Seconds(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break;
return(data.substring(i+1,data.length));
}
function Display(min,sec) {
var disp;
if(min<=9) disp=" 0";
else disp=" ";
disp+=min+":";
if(sec<=9) disp+="0"+sec;
else disp+=sec;
return(disp);
}
function Up() {
cmin1=0;
csec1=0;
min1=0+Minutes(document.sw.beg1.value);
sec1=0+Seconds(document.sw.beg1.value);
UpRepeat();
}
function UpRepeat() {
csec1++;
if(csec1==60) {
csec1=0; cmin1++;
}
document.sw.disp1.value=Display(cmin1,csec1);
if((cmin1==min1)&&(csec1==sec1))
alert("Stopwatch Stopped");
else up=setTimeout("UpRepeat()",1000);
}
function Down() {
cmin2=1*Minutes(document.sw.beg2.value);
csec2=0+Seconds(document.sw.beg2.value);
DownRepeat();
}
function DownRepeat() {
csec2--;
if(csec2==-1) {
csec2=59; cmin2--;
}
document.sw.disp2.value=Display(cmin2,csec2);
if((cmin2==0)&&(csec2==0))
alert("Countdown Stopped");
else down=setTimeout("DownRepeat()",1000);
}
// End -->
</SCRIPT>

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

<BODY>

<CENTER>
<FORM name="sw">
<TABLE border="0" width="100%">
<tr align="center">
<td><table border="3" width="100%"><tr>
<th colspan="2">Stopwatch</th></tr>
<tr align="center">
<td>Stop at<br>
<input type="text" name="beg1" size="7" value="0:10"></td>
<td><input type="button" value="Start" onclick="Up()"></td>
</tr>
<tr align="center"><td colspan="2">
<input type="text" name="disp1" size="7"></td></tr></table></td>
<td>
<input type="button" value="Start Both" onclick="Up();Down()">
</td>
<td>
<table border="3" width="100%">
<tr align="center">
<td>Start at<br><input type="text" name="beg2" size="7" value="0:10"></td> <td><input type="button" value="Start" onclick="Down()"></td>
</tr>
<tr align="center"><td colspan="2">
<input type="text" name="disp2" size="7"></td></tr></table></td></tr>
</TABLE>
</FORM>
</CENTER>



<!-- Script Size: 2.72 KB -->
+ نوشته شده در  2006/9/4ساعت 15:21  توسط حسين زارعي  | 

This is a really neat little script that can display the current time in "Military Time" or "12 Hour

<!-- THREE STEPS TO INSTALL CLOCK TYPE:

1. Paste the first code in the HEAD of your HTML document
2. Copy the onLoad event handler into the BODY tag
3. Add the last code in the BODY of your HTML document -->

<!-- STEP ONE: Paste the first code in the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">




<!-- Begin
function showMilitaryTime() {
if (document.form.showMilitary[0].checked) {
return true;
}
return false;
}
function showTheHours(theHour) {
if (showMilitaryTime() || (theHour > 0 && theHour < 13)) {
if (theHour == "0") theHour = 12;
return (theHour);
}
if (theHour == 0) {
return (12);
}
return (theHour-12);
}
function showZeroFilled(inValue) {
if (inValue > 9) {
return "" + inValue;
}
return "0" + inValue;
}
function showAmPm() {
if (showMilitaryTime()) {
return ("");
}
if (now.getHours() < 12) {
return (" am");
}
return (" pm");
}
function showTheTime() {
now = new Date
document.form.showTime.value = showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + ":" + showZeroFilled(now.getSeconds()) + showAmPm()
setTimeout("showTheTime()",1000)
}
// End -->
</script>

<BODY onLoad="showTheTime()">

<!-- STEP THREE: Add the last code in the BODY of your HTML document -->

<BODY>

<center><form name=form>
<input type=text name=showTime size=11><p>
<input type=radio name=showMilitary checked>Military Time<br>
<input type=radio name=showMilitary>12 Hour Time<br>
</form></center>



</table>
</form>
</FONT>
</CENTER>


</center>
</body></html>
+ نوشته شده در  2006/9/4ساعت 15:20  توسط حسين زارعي  |