cookie set from select created with javascript from external file- not working - help

E

Ed

I have a dropdown menu that is populated by an external file with the
use of a script.

I want to place the results of this in a cookie.
My cookie works great for the user_name and user_phone...but I can't get
this ad code to work correctly...the cookie does not save that
information. What have I done wrong?

<head>
<script language="JavaScript">
function setCookie() {
var expiresDate = new Date();
expiresDate.setFullYear(expiresDate.getFullYear() + 1);
document.cookie = encodeURI("user_name="
+ document.twork.proc_by.value) + "; expires="
+ expiresDate.toUTCString();
document.cookie = encodeURI("user_phone="
+ document.twork.procphone.value) + "; expires="
+ expiresDate.toUTCString();
document.cookie = encodeURI("ad"
+
document.twork.ad_code.options[document.twork.ad_code.selectedIndex].value)
+ "; expires="
+ expiresDate.toUTCString();
}
</script>
</head>

<body>
<script language="JavaScript">
document.write("<select name=\"ad_code\" id=\"ad_code\" size=\"1\"
class=\"regSoft\" onBlur=\"doSetAd()\">");
for(i=0; i<divCodes.length; i++){
document.write("<option>");
document.write(divCodes);
document.write("</option>");
}
document.write("</select>");
</body>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top