Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 09:09 AM
Ed
Guest
 
Posts: n/a
Default cookie set from select created with javascript from external file- not working - help

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[i]);
document.write("</option>");
}
document.write("</select>");
</body>


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.