Hi, im trying to pull the email value from a cookie, then split the email into 2 parts to use as value for input box.. but its not working out.
here is my code:
Code:<script type="text/javascript"> function getCookie(mailaddress) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies.substr(0,ARRcookies.indexOf("=")); y=ARRcookies.substr(ARRcookies.indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==mailaddress) { var thisemail=y; } var email_split=thisemail.split("@"); var email_name=email_split[0]; var email_domain=email_split[1]; } } </script> <input size="20" class="text" name="_username" type="text" value="<myCookie: var email_name />" readonly>



Reply With Quote

Bookmarks