Haven't used cookies before really but I'd like to create a cookie that remembers the options a user has selected so they can have their styling next time they visit. The user selects the styles through 2 drop down boxes.
Just wondering how I would do it and asking for a bit of help.
Below are the drop down boxes for the information I would like the cookie to remember.
HTML Code:
<script type="text/javascript">
function fontsize() {
selectedstyle = document.form1.font.selectedIndex;
newsize = document.form1.font.options[selectedstyle].value;
document.getElementById("userstyle").style.fontSize = newsize;
}
function fontcolour() {
selectedstyle = document.form1.color.selectedIndex;
newcolor = document.form1.color.options[selectedstyle].value;
document.getElementById("userstyle").style.color = newcolor;
}
</script>
<div id="userstyle">
<body>text
<form name="form1">
<select name="font" onChange="fontsize();">
<option value = "16px">Normal Size</option>
<option value = "22px">Medium Size</option>
<option value = "26px">Large Size</option>
</select>
<select name="color" onChange="fontcolour();">
<option value = "#ffffff">White</option>
<option value = "#000000">Black</option>
<option value = "#666666">Grey</option>
<option value = "#ff0000">Red</option>
</select>
</form>
</body>
</div>