WELCOME  TO   ENJOY  ELECTRONICS  WITH  PARTH.  PLEASE  LIKE  US  ON   FACEBOOK.

ebooks

websites

electronics
projects

microcontoller
8051

robotics

8085
microprocessor

HTML/JavaScript

Thursday, 23 June 2011

Javascript based death counter

I have seen this software called "death counter" which give your "date of death" when you provide your birth date.Then i decide to make a Java script based death counter I try for it and succeed. This make your blog an amusement for visitor .

code:

<script type="text/JavaScript">
<!--
function newData(n1,n2,n3)
{
 var no1 = parseInt(n1);
 var no2 = parseInt(n2);
 var no3 = parseInt(n3);

if
((no1+5)>28)
{
frm.ndate.value =26;
}
else
{
frm.ndate.value =no1+5;
}


if
((no2+2)>12)
{
frm.nmonth.value =4;
}
else
{
frm.nmonth.value =no2+2;
}


frm.nyear.value = no3+75;
}

function clearNumbers()
{
frm.number1.value = "";
frm.number2.value = "";
frm.number3.value = "";
frm.ndate.value = "";
frm.nmonth.value = "";
frm.nyear.value = "";
}
-->
</script>



<form name="frm" method="post">
<font face="verdana" color="red">
<font face="verdana" color="red" size="+2"><h2>Don't know<br /> when will you die?</h2></font>

<h3>please give your birth date:</h3>

<h4> Date:
<input type="text" name="number1" size="2" maxlength="2" />

Month:
<input type="text" name="number2" size="2" maxlength="2" /><br /><br />

Year:
<input type="text" name="number3" size="4" maxlength="4" /><br /><br />
<font face="verdana" color="red">
<h3>you wil die on:</h3> </font>
date:<input type="text" name="ndate" size="2" />
month:<input type="text" name="nmonth" size="2" /><br /><br />
year:<input type="text" name="nyear" size="4" /><br /><br />



<input type="button" name="AddButton" value="Go"
onclick="newData(number1.value,number2.value,number3.value)" />

<input type="button" name="ClearButton" value="Clear Fields"
onclick="clearNumbers()" /> <br /><br />
</h4>
<font face="verdana" color="#66bbdd ">Disclaimer: This date doesn’t indicate the actual date of death.
I am not responsible if anybody really dies on the date indicated it will be just coincidence.
This is just for fun. Only god knows when we will die.
Otherwise my personally wish that you live longer and longer & god may bless you.
We don't store your birthdate.</font><br /><br />
created by:parth pandya

</font>

</form>
 







 To add this JavaScript to your blog steps as shown on this page should be followed.HTML based menu bar

No comments:

Post a Comment