I’ve got a form that has an input that I want to autopopulate when the user selects a value on another input. The value I want to put in comes from a cookie. Here’s the code I have:
[CODE][function UpdateStatus(){
var objDate = new Date()
var strTemp = “”
if(document.getElementById(“statuslist”).value == “Closed”){
// Update CloseDate
if(document.getElementById(“CloseDate”).value == “”){
strTemp = (objDate.getMonth() + 1) + “/” + objDate.getDate() + “/” + objDate.getFullYear()
document.getElementById(“CloseDate”).value = strTemp
}
}
// Update Close User
if(document.getElementById(“CloseUser”).value == “”){
if(GetCookie(“USER”) != null && GetCookie(“USER”) != “” )
{document.getElementById(“CloseUser”).value = getCookie(“USER”)}
else
{document.getElementById(“CloseUser”).value = document.getElementById(“EditBy”).value}
}
}
This function is run via an “onchange” event tied to a drop down list. The first part actually works and the time/date gets filled in. It’s the second part where I’m trying to pull a value from a cookie that fails. The value does exist and I have no problem calling the value using ColdFusion’s cookie handling tags. I’m very inexperienced with JS, so I’m not quite sure where I’ve gone wrong.
Thanks!