Topic awaiting preservation: javascript cookies (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: #UK SURREY |
posted 03-02-2005 11:36
I need to implement a cookie and need some help - even after some research I cant find a "cut and paste" example that I understand!!! |
Paranoid (IV) Inmate From: France |
posted 03-02-2005 12:38 |
Bipolar (III) Inmate From: #UK SURREY |
posted 03-02-2005 13:16
I have found this code... it uses check boxs to deploy the cookie - is there anyway to use <a href> tags to set the cookie if just one check box is ticked. i.e. 2 links (bs & it) one check box and no form elements to call just <a> tags? code: <SCRIPT LANGUAGE="JavaScript">
code: <form>
|
Paranoid (IV) Inmate From: France |
posted 03-02-2005 14:27
Sorry, without a link I'm too tired to look closely at that (unindented) source code. |
Bipolar (III) Inmate From: #UK SURREY |
posted 03-02-2005 14:46
Thanks POI, not that any of it makes any sense to me - i have no javascript skills yet (apart from cut and paste). i have read through the tutorials and either they do not offer what i am looking for or more likely that i just dont understand. |
Paranoid (IV) Mad Librarian From: Glienicke |
posted 03-02-2005 21:26
Assuming that the cookie functions you found do their job properly that's perfectly doable. code: <form name="cookie_option">
code: <a href="page2.html" onclick="if (document.forms['cookie_option'].elements['remember_choice'].checked)
|
Bipolar (III) Inmate From: #UK SURREY |
posted 03-03-2005 17:24
thanks kuckus, |
Paranoid (IV) Inmate From: France |
posted 03-03-2005 17:35 |
Bipolar (III) Inmate From: #UK SURREY |
posted 03-07-2005 13:19
I cant seem to get the deleteCookie function to work - this is the call i have: code: <a href="http://www.domain.co.uk/index.shtml" title="Home" onclick=" {DeleteCookie('selection'); }">home</a>
|
Paranoid (IV) Inmate From: France |
posted 03-07-2005 13:26 |
Bipolar (III) Inmate From: #UK SURREY |
posted 03-07-2005 14:53
thanks poi. yep works but only if you restart i.e.... is that right? |
Paranoid (IV) Inmate From: France |
posted 03-07-2005 15:39
it should work without restarting your "browser". Try in another browser. The cache of IE is well known for being hungry. It might trick you. |
Bipolar (III) Inmate From: #UK SURREY |
posted 03-08-2005 10:22
actually the cookie gets deleted every time i restart IE, regardless of the whether i call the DeleteCookie function or not... it does not make sense, it is meant to expire after 30 days surely? |
Paranoid (IV) Inmate From: France |
posted 03-08-2005 11:17 |