<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- 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  توسط K-Pax
|
<!-- ONE STEP TO INSTALL BUTTON TIME:
1. Put the coding into the BODY of your HTML document -->
<!-- STEP ONE: Add this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Michael Tartaglia <stonedstan@hotmail.com> -->
<!-- Web Site: http://www.geocities.com/SiliconValley/Horizon/5235 -->
<! >
<! >
<!-- Begin
day = new Date();
miVisit = day.getTime();
function clock() {
dayTwo = new Date();
hrNow = dayTwo.getHours();
mnNow = dayTwo.getMinutes();
scNow = dayTwo.getSeconds();
miNow = dayTwo.getTime();
if (hrNow == 0) {
hour = 12;
ap = " AM";
} else if(hrNow <= 11) {
ap = " AM";
hour = hrNow;
} else if(hrNow == 12) {
ap = " PM";
hour = 12;
} else if (hrNow >= 13) {
hour = (hrNow - 12);
ap = " PM";
}
if (hrNow >= 13) {
hour = hrNow - 12;
}
if (mnNow <= 9) {
min = "0" + mnNow;
}
else (min = mnNow)
if (scNow <= 9) {
secs = "0" + scNow;
} else {
secs = scNow;
}
time = hour + ":" + min + ":" + secs + ap;
document.form.button.value = time;
self.status = time;
setTimeout('clock()', 1000);
}
function timeInfo() {
milliSince = miNow;
milliNow = miNow - miVisit;
secsVisit = Math.round(milliNow / 1000);
minsVisit = Math.round((milliNow / 1000) / 60);
alert("There have been " + milliSince + " milliseconds since midnight, January 1, 1970. "
+ "You have spent " + milliNow + " of those milliseconds on this page. "
+ ".... About " + minsVisit + " minutes, and "
+ secsVisit + " seconds.");
}
document.write("<form name=\"form\">"
+ "<input type=button value=\"Click for info!\""
+ " name=button onClick=\"timeInfo()\"></form>");
onError = null;
clock();
// End -->
</SCRIPT>
<!-- Script Size: 1.72 KB -->
|
+|
نوشته شده در
2006/9/4ساعت 15:19  توسط K-Pax
|
<!-- TWO STEPS TO INSTALL BINARY CLOCK:
1. Copy the coding into a new file, save as binaryclock.js
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Save this code as a new file: binaryclock.js -->
<!-- Original: Mark Lockwood (sy161e.net@namezero.com) -->
<!-- Web Site: http://www.sy161e.net -->
<! >
<! >
function syeClock() {
if (!document.layers && !document.all)
return;
timePortion = new Array;
maxLength = new Array;
var runTime = new Date();
timePortion[0] = runTime.getHours();
timePortion[1] = runTime.getMinutes();
timePortion[2] = runTime.getSeconds();
maxLength[0] = 5;
maxLength[1] = 6;
maxLength[2] = 6;
var decValue = 0;
var decMod = 0;
var temp = "";
var hoursBackground = "#7B7BB5";
var minutesBackground = "#4D5487";
var secondsBackground = "#424A63";
var colonBackground = "#000000";
var textColor = "#FFFFFF";
for (var curPor = 0; curPor <= 2; curPor++) {
decValue = timePortion[curPor];
timePortion[curPor] = "";
while (decValue != 0) {
decMod = decValue % 2;
decValue = Math.floor(decValue / 2);
timePortion[curPor] = decMod + timePortion[curPor];
}
if (timePortion[curPor].length < maxLength[curPor]) {
for (var i = 1; i <= maxLength[curPor] - timePortion[curPor].length; i++) {
temp += "0";
}
}
timePortion[curPor] = temp + timePortion[curPor];
temp = "";
}
movingtime = '<table border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor='+ hoursBackground +'><font color='+ textColor +'>' + timePortion[0] + '</font></td><td bgcolor='+ colonBackground +'>:</td><td bgcolor='+ minutesBackground +'><font color='+ textColor +'>' + timePortion[1] + '</font></td><td bgcolor='+ colonBackground +'>:</td><td bgcolor='+ secondsBackground +'><font color='+ textColor +'>' + timePortion[2] + '</font></td></tr></table>';
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
setTimeout("syeClock()", 1000)
}
window.onload = syeClock;
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<script language="JavaScript" src="binaryclock.js"></script>
<p align="center">
Binary Time<br>
<span id="clock" style="position:relative;"></span>
</p>
<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: 2.43 KB -->
|
+|
نوشته شده در
2006/9/4ساعت 15:19  توسط K-Pax
|
<!-- THREE STEPS TO INSTALL BAR CLOCK:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Abraham I. (abraham_824@hotmail.com) -->
<! >
<! >
<!-- Begin
function clock() {
var t = new Date();
var h = t.getHours();
var m = t.getMinutes();
var s = t.getSeconds();
var units = new String("");
var hours = t.getHours();
var min = t.getMinutes();
var sec = t.getSeconds();
document.clock.hours.value = units.substring(0, hours);
document.clock.minutes.value = units.substring(0, min);
document.clock.seconds.value = units.substring(0, sec);
var status = "AM";
if (hours > 11)
status = "PM";
if (hours < 11)
hours -= 12;
if (min < 10)
min = "0" + min;
if (sec < 10)
sec = "0" + sec;
document.clock.h.value = hours;
document.clock.m.value = min;
document.clock.s.value = sec;
document.clock.time.value = hours + ":" + min + ":" + sec + " " + status;
window.setTimeout("clock()", 900);
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="clock();">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<form name="clock">
<table>
<tr>
<td>
Hours:
</td>
<td>
<input type="text" name="h" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="hours" size="24" style="color: navy">
</td>
</tr>
<tr>
<td>
Minutes:
</td>
<td>
<input type="text" name="m" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="minutes" size="60" style="color: navy">
</td>
</tr>
<tr>
<td>
Seconds:
</td>
<td>
<input type="text" name="s" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="seconds" size="69" style="color: navy">
</td>
</tr>
<tr>
<td>
Time: <input type=text name="time" size="20" style="border: 0">
</td>
</tr>
</table>
</form>
<!-- Script Size: 3.07 KB -->
|
+|
نوشته شده در
2006/9/4ساعت 15:18  توسط K-Pax
|
<!-- THREE STEPS TO INSTALL ALARM CLOCK:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: John Caranta (caranta@netzero.net) -->
<! >
<! >
<!-- Begin
var alarmTime;
var curTime;
var check = new Date();
var hourNum;
var minNum;
function GetTime() {
var dt = new Date();
document.clock.local.value = IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes());
setTimeout("GetTime()", 1000);
curTime = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()));
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function alarmSet() {
hourNum = document.clock.hourOpt[document.clock.hourOpt.selectedIndex].value;
minNum = document.clock.minOpt[document.clock.minOpt.selectedIndex].value;
alarmTime = hourNum + ":" + minNum;
}
function alarmOn() {
if (alarmTime == curTime) {
document.all.sound.src = document.clock.alarmSound.value;
}
else {
setTimeout("alarmOn()", 1000)
}
}
function alarmOff() {
document.all.sound.src = "";
alarmTime="";
}
function snooze() {
document.all.sound.src = "";
var snoozeL = parseInt(document.clock.snoozeOpt[document.clock.snoozeOpt.selectedIndex].value);
var snooze = new Date();
alarmTime = IfZero(snooze.getHours()) + ":" + IfZero(snooze.getMinutes() + snoozeL);
alarmOn();
}
// End -->
</script>
<bgSound src="" id="sound">
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="GetTime()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<table width=100% border=1>
<tr>
<td align=middle>
<form name="clock">
<input size="8" name="local">
<input type=radio name=alarmOnOff onClick="alarmOn()">On
<input type=radio name=alarmOnOff onClick="alarmOff()" checked>Off
<td align=middle>
Set Alarm:
<br>
<select name=hourOpt onChange="alarmSet()" size=1>
<option value="00">00<option value="01">01<option value="02">02<option value="03">03
<option value="04">04<option value="05">05<option value="06">06<option value="07">07
<option value="08">08<option value="09">09<option value="10">10<option value="11">11
<option selected value="12">12
<option value="13">13<option value="14">14<option value="15">15<option value="16">16
<option value="17">17<option value="18">18<option value="19">19<option value="20">20
<option value="21">21<option value="22">22<option value="23">23
</option>
</select>
<select name=minOpt onChange="alarmSet()" size=1>
<option selected value="00">00<option value="01">01<option value="02">02<option value="03">03
<option value="04">04<option value="05">05<option value="06">06<option value="07">07
<option value="08">08<option value="09">09<option value="10">10<option value="11">11
<option value="12">12<option value="13">13<option value="14">14<option value="15">15
<option value="16">16<option value="17">17<option value="18">18<option value="19">19
<option value="20">20<option value="21">21<option value="22">22<option value="23">23
<option value="24">24<option value="25">25<option value="26">26<option value="27">27
<option value="28">28<option value="29">29<option value="30">30<option value="31">31
<option value="32">32<option value="33">33<option value="34">34<option value="35">35
<option value="36">36<option value="37">37<option value="38">38<option value="39">39
<option value="40">40<option value="41">41<option value="42">42<option value="43">43
<option value="44">44<option value="45">45<option value="46">46<option value="47">47
<option value="48">48<option value="49">49<option value="50">50<option value="51">51
<option value="52">52<option value="53">53<option value="54">54<option value="55">55
<option value="56">56<option value="57">57<option value="58">58<option value="59">59
</option>
</select>
<tr>
<td align=middle>
Select Alarm Sound:
<br>
<input type=file size=4 name=alarmSound>
<td align=middle>
Snooze For:
<br>
<select NAME=snoozeOpt size=1 onChange="snooze()">
<option value="1">1<option value="2">2<option value="3">3<option value="4">4
<option value="5">5<option value="6">6<option value="7">7<option value="8">8
<option value="9" selected>9
</option>
</select>
</form>
</td>
</tr>
</table>
<!-- Script Size: 5.28 KB -->
|
+|
نوشته شده در
2006/9/4ساعت 15:17  توسط K-Pax
|
<!-- THREE STEPS TO INSTALL AGE FINDER:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Glub, Un-Inc. -->
<! >
<! >
<!-- Begin
var mm = prompt('What month were you born in?','1-12');
var bday = prompt('What day were you born on?','1-31');
var byear = prompt('What year were you born in?','1975');
var year = new Date();
var year2 = year.getYear();
var year3 = (year < 2000) ? year2 + 1900 : year2;
thedate = new Date();
mm2 = thedate.getMonth() + 1;
dd2 = thedate.getDate();
yy2 = thedate.getYear();
if (yy2 < 100) yy2 += 1900
yourage = yy2 - byear;
if (mm2 < mm) yourage--;
if ((mm2 == mm) && (dd2 < bday)) yourage--;
TMonth = new Array(
'January','February','March',
'April','May','June','July',
'August','September','October',
'November','December'
);
CurMonth = mm - 1;
bmonth = TMonth[CurMonth];
var age2 = yourage + 1;
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var enday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
function stopclock() {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock() {
stopclock();
showtime();
showtime1();
}
function showtime() {
today = new Date();
enday = new Date(""+bmonth+", "+bday+" "+year3+" 00:00");
enday.setYear(""+year3+"");
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (enday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((enday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((enday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((enday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.down.face.value = timeRemain;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
if (daysRemain < 0) year3 = year3 + 1
}
function showtime1() {
startday = new Date(""+bmonth+" "+bday+", "+byear+" 00:00 EDT");
startday.setYear(""+byear+"");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
if (daysRemain == 1) day_rem = " day, "
else day_rem = " days, "
if (hoursRemain == 1) hour_rem = " hour, "
else hour_rem = " hours, "
if (minRemain == 1) min_rem = " minute, "
else min_rem = " minutes, "
if (secsRemain == 1) sec_rem = " second"
else sec_rem = " seconds"
timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
document.up.face.value = timeRemain;
timerID = setTimeout("showtime1()",1000);
timerRunning = true;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="startclock()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<center>
<form name="down" onSubmit="0">
<script Language="JavaScript">
document.write("<b>I was born "+bmonth+" "+bday+", "+byear+". ("+mm+"/"+bday+"/"+byear+")</b>");
document.write("<br><br>I am "+yourage+" years old, and will turn "+age2+" in:");
</script>
<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
<p>
<br>
<form name="up" onSubmit="1">
I've been alive for...<br>
<input type="text" name="face" size="47" value="A browser supporting JavaScript 1.1+ is needed.">
</form>
</center>
<!-- Script Size: 6.04 KB -->
|
+|
نوشته شده در
2006/9/4ساعت 15:16  توسط K-Pax
|