Avatar of vrmetro
Flag for United States of America

asked on 

JS setting cookie onchange with other functions

I'm trying to set a cookie by the name of FindWhere, with the value of the drop down, below is the code I have so far, the onChange drop down isn't working, not sure if that's because trying to accomplish two different things with the change.  Also, I don't know how to set the cookie name of FindWhere and make sure the value it is given, is that of the drop down.  Code below.

Thank you,
<select style="font-size: 12px; width: 150px" onchange="window.open(this.options[this.selectedIndex].value,'myIFrame');onchange=" name="dest">
// setCookie function
function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());

Open in new window


Avatar of undefined
Last Comment

8/22/2022 - Mon