Birthday Script

Sep 22, 2003

This script determins the current date, and if that date is someones birthday (from a list of birthdays, names and dates) It prints a customisable message.
(different message for eagh entry if you want!)

It's a very simple script but it works well. Put it between HTML tags to change the output text apperance.

Here is the script:

<script language="JavaScript">

var date=new Date()
var year=date.getYear()
if (year < 1000)
year+=1900
var day=date.getDay()
var month=date.getMonth()
var daym=date.getDate()

//Birthday List
if ((month = 9) && (date = 21)) document.write("somebody's birthday");

</script>

//to add more that one entry, just copy the first and paste it back into the script, changing the contents...

View 41 Replies


ADVERTISEMENT

Populating The Birthday Through A Loop?

Jul 11, 2010

we're just starting our lesson on JavaScript and i need to make a form that ask the user's birthday on a drop down menu, but the day drop down menu ranges from 1-31 must be populated using a javascript loop and also the year. Then after the user selects the birthday, the age will be shown automatically.

View 1 Replies View Related

JS Birthday Combo Box Dropdown Selector?

May 27, 2011

ok so I have 3 combo boxes one for each of month day and year. In the <select> tag for both the month and year i have onchange="setDate();". Below is what the function setDate actually does.

Code:
function setDate()
{

[code]....

View 6 Replies View Related

Data Validation For A Birthday Field?

Nov 3, 2011

I am having difficulty with my javascript data validation for a birthday field. The error is coming up correctly, but the result is never returned as true. Even if I enter the date correctly, the error "Invalid date! The correct date format is like '01/01/2004'. Please try again." comes up. This data validation is for a contact form that i've developed for a personal site. Can someone please stear me in the right direction? I feel as if this is a simple syntax error, but I have looked at it for hours and cannot seem to find any error in script or the functions.Here is the code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

[code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved