PDA

View Full Version : object doesn't support this property or method


zenweezil
05-04-2003, 10:39 AM
When I test this code with a preview (a temp file viewed in the browser) it works fine. But when I upload it to the server and view it I get this error: object doesn't support this property or method

THe error also points to the document.links line in the code

Why would it work in my browser off my hard drive but not off my server?

FYI: the code is for a form to query an asp calendar page.

<script language="JavaScript">
var today=new Date();

//chage url
function changeUrl(form,s,add) {

var sField; //variable to store Form Elements
sUrl = new String(""); //variable for making URL
var sOpenerURL = add; //URL
for(i=0;i<form.length;i++) {
//take form's element in the variable
sField = form.elements[i];
//construct the URL

sUrl = sUrl + "&" + sField.name + "=" + escape(sField.value);

}
//trim the first "&"
sUrl = sUrl.substring(1,sUrl.length);
//Add the URL
sUrl = sOpenerURL + "?" + sUrl;

//chage address
document.links[s].href=sUrl + "&lstStartMonth=" + (today.getMonth()+1) + "&lstStartDay=" + today.getDate() + "&lstStartYear=2003&lstEndMonth=All&lstEndDay=All&lstEndYear=All&xxxx=Go";
// the variable s contains
return false;
}

</script>