Please see following example code that takes a year and a date and displays the data back when submitted...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript</title>
</head>
<body>
<FORM NAME="myform" ACTION="" METHOD="GET">
Enter the year to start from (eg: 2006): <BR>
<INPUT TYPE="text" NAME="year" VALUE=""><P>
Enter starting day (eg: 1= 1st Jan): <BR>
<INPUT TYPE="text" NAME="day" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Go!" onClick="testResults(this.form)">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var years = form.year.value;
var days = form.day.value;
for (var x = days; x <= 365; x++)
{
for (var y = years; y <= 2010; y++)
{
document.write(' ValueY='+y+'ValueX='+x+' ')
}
document.write("<br />");
}
}
function to3P(n){
return (n/100).toFixed(2).replace(/\./, '');
};
</SCRIPT>
</body>
</html>
What I'm trying to work out is how to LEAVE the form on the page after the document.write happens..(so the user doesn't have to keep pressing back to try new data!