faqts : Computers : Programming : Languages : JavaScript : Document

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

How can I write to a Label3 which is on a form ?

Jan 7th, 2005 04:39
Stan Page,


The script I have is:
<body>
    <p>
    </p>
    <center><b><u> <script language="JavaScript">
<!-- Begin

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
;

// Array list of months.
var months = new Array
('January','February','March','April','May','June','July','August','Sept
ember','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + ", " +
         months[now.getMonth()] + " " +
         date + ", " +
         (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);
//  End -->
</script>
        </u></b>
    </center>
    <p>
    </p>
When there is a Label3 on the page = How can I write the (today) to
that label ?

Thanks