faqts : Computers : Programming : Languages : JavaScript : Forms : Checkboxes

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 39 people (41%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I set a cookie when ticking a checkbox?

Aug 26th, 2000 08:48
Martin Honnen, David Rabbich,


http://www.faqts.com/knowledge-base/view.phtml/aid/1977/fid/126
explains how to write and read cookies. Simply apply that code in the 
onclick handler of your checkbox so in the simplest case
  <INPUT TYPE="checkbox" NAME="aCheckBox" VALUE="Kibology"
         ONCLICK="document.cookie = this.name + '=' + this.value;"
  >