Cookie Javascript

They have: 268 posts

Joined: May 1999

Could one of you javascript gurus please look at the following page and tell me what I need to add in order to set a cookie on a drop down list?

www.shoutingrock.org/troop214/EmergContact.html

Thanks in advance for your help.

------------------

[This message has been edited by Jim Shilt (edited 30 November 1999).]

My goal in life is found in Phillipians 4:8-9
shoutingrock.org/troop214

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

Unfortunately I'm not very experienced with cookies yet, but someone should be able to help out.

They have: 5,633 posts

Joined: Jan 1970

If I've understood you you want to assign a new cookie value from a drop down list. The following should work:

<select name="ListName" onChange="SetCookie('ListName', document.demoform.ListName.options[document.demoform.ListName.selectedIndex].value, expdate)>
<option selected value="value1">Option 1
<option value="value2">Option 2
<option value="value3">Option 3
</select>

This will set the value of 'ListName' from the selected option to the cookie. Hope this helps

They have: 268 posts

Joined: May 1999

Thanks a million Tomworld.

The script worked just like you said it would.

They have: 5,633 posts

Joined: Jan 1970

Pleased to be able to help

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.