Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > cookie set from select created with javascript from external file- not working - help

Thread Tools

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

Posts: n/a
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?

<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"
+ "; expires="
+ expiresDate.toUTCString();

<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++){

Reply With Quote

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a cookie using Cookie Module Python 2 01-08-2009 02:39 PM
Is there a way to set a cookie with CGI::Cookie objects, from anrhtml file? Xeno Campanoli Ruby 2 07-09-2008 11:07 PM
Cookie Confusion - How to Set a Cookie Python 5 05-02-2008 02:56 PM
Cookie not created! Help please. Clint ASP .Net 4 10-31-2003 02:51 PM
Cookies set one time, I delete cookie, cookie is never set again! Phil Powell Javascript 2 09-05-2003 02:17 PM