Hey,
can someone please tell me why the code below will not add a value to a hidden field, but it will output to screen:
<SCRIPT LANGUAGE="Javascript">
<!--
// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");
// Array of month Names
var monthNames = new Array(
"January","February","March","April","May","June","July",
"August","September","October","November","December");
var now = new Date();
var super = (dayNames[now.getDay()] + ", " +
monthNames[now.getMonth()] + " " +
now.getDate() + ", " + now.getFullYear());
// -->
</script>
<body><script>document.write(dayNames[now.getDay()] + ", " +
monthNames[now.getMonth()] + " " +
now.getDate() + ", " + now.getFullYear());
document.getElementByID("newsdates").value = (super);</script>
<input type="hidden" name="newsdates" id="newsdates" value="" />
</body>
</html>
When I load the page it should add the date to the value by id, but I cant get it to work.
Thanks in advance
Cheers
Rob
can someone please tell me why the code below will not add a value to a hidden field, but it will output to screen:
<SCRIPT LANGUAGE="Javascript">
<!--
// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");
// Array of month Names
var monthNames = new Array(
"January","February","March","April","May","June","July",
"August","September","October","November","December");
var now = new Date();
var super = (dayNames[now.getDay()] + ", " +
monthNames[now.getMonth()] + " " +
now.getDate() + ", " + now.getFullYear());
// -->
</script>
<body><script>document.write(dayNames[now.getDay()] + ", " +
monthNames[now.getMonth()] + " " +
now.getDate() + ", " + now.getFullYear());
document.getElementByID("newsdates").value = (super);</script>
<input type="hidden" name="newsdates" id="newsdates" value="" />
</body>
</html>
When I load the page it should add the date to the value by id, but I cant get it to work.
Thanks in advance
Cheers
Rob