TeddyKiller Posted May 30, 2010 Share Posted May 30, 2010 I have this javascript function... function setCookie(VALUE) { var NAME = 'myCookie'; var DATE = new Date(); DATE.setTime(DATE.getTime()+(15*60)); // Minutes * Seconds var EXPIRE = DATE.toGMTString(); document.cookie = NAME + "=" + VALUE+"; expires=" + EXPIRE + " path=/"; } then I have this.. <input type="text" name="pollName" onkeyup="setCookie(this.value)" value="<?php echo $_COOKIES['myCookie'] ?>"/> It doesn't echo the cookies value.. whats wrong? Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted June 3, 2010 Share Posted June 3, 2010 You know, I have a lot of issues with referencing this while using html tags. Try changing this to the actual reference. So give your input an id and use document.getElementById("id_of_element").value Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.