DEVPPL
http://www.devppl.com/forum/

Help with cookies
http://www.devppl.com/forum/viewtopic.php?f=49&t=13661
Page 1 of 1

Author:  mcbc [ Wed Jun 03, 2009 10:12 pm ]
Post subject:  Help with cookies

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]

Author:  mcbc [ Fri Jun 05, 2009 6:13 pm ]
Post subject:  Re: Help with cookies

I figured it out, I was calling the variable by its name, and not its ID.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/