It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

Help with cookies

Help with cookies

Postby mcbc on Wed Jun 03, 2009 10:12 pm

Hello I have the following code, and I can not get it to work correctly. Any help would be greatly appreciated.
[code]
<SCRIPT LANGUAGE="JavaScript">
<!--
function SetCookie(cookieName,cookieValue,nDays) {
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)
+ ";expires="+expire.toGMTString()+
'path=/;domain=can-labels.com';
}
//-->
</SCRIPT>
<form name="frmMCQuotes" id="frmMCQuotes" action="feedback.php" method="post" >
<table>
<tr>
<td width="77"><span class="style5"><b> City:</b></span></td>
<td width="263"><input type="text" name="Shipping-City" id="txtCityShip" size="20" maxlength="20" /></td>
</tr>
<tr>
<td width="85"><input type="button" value="Calculate" name="btnCalcBC"
onClick="SetCookie('ShippingCity',this.form.Shipping-City.value,'1')"/></td>
</tr>
</table></form>
[/code]
mcbc
 
Posts: 14
Joined: Wed May 21, 2008 4:22 pm

Re: Help with cookies

Postby mcbc on Fri Jun 05, 2009 6:13 pm

I figured it out, I was calling the variable by its name, and not its ID.
mcbc
 
Posts: 14
Joined: Wed May 21, 2008 4:22 pm


Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 6 guests