Message Text |
Hi
I am trying to add an onload event, but there is aready an onload in the code when the page loads, so my onload doesn't work.
Here's what I need to do...
I am trying to automatically set the date in some drop down form fields.
I wanted to add the following code to the opening body tag.. onload=setDrops(document.searchform)
and the following code to the head section...
<SCRIPT language=JavaScript>
<!--
var now = new Date();
var theday = now.getDate()-1;
var themonth = now.getMonth();
var theyear = now.getFullYear();
function setDrops(theForm) {
theForm.day.selectedIndex = theday;
theForm.month.selectedIndex = themonth;
var found = 0;
for(i=1;i<theForm.year.options.length;i++) {
if (theForm.year.options[i].value == theyear) {
found = i;
break;
}
}
theForm.year.selectedIndex = found;
}
//-->
</SCRIPT>
However, because WSN links already inserts an onload event, it doesn't work. How can I use my onload event with WSN links?
|