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>
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>