i’m a newbie to cookies. trying to create a cookie when user has successfully submitted email (i.e. [email][email protected][/email] vs just joe). when user revisits i can determine which page to display, registration or login page, depending if the cookie is present or not.
@justinbarneskinFeb 26.2009 — #Not hard at all. You only need your basic cookie script and refer to it in a script tag.
Once you find you do-all to end-all your cookie needs, you can use it over and over again on different pages for different forms. Just need to name each cookie unique.
When you run the cookie example you get a text input and a submit button. //where's txt input String written in this line?
setCookie('cookietest',document.getElementById("t1").value,1); [/QUOTE] "document.getElementById("t1").value" gets the string value entered from the text input box. Enter whatever text you want to place in the cookie here. //is this testing if cookie present or not?
alert(getCookie('cookietest')); [/QUOTE]Yes, the value displayed in the alert is coming from the cookie //what does this do?
thx for the info. i'm able to create and store a cookie now?
however, i need to validate email before i create cookie. i found a script to do this.
the script calls validateForm( ) which calls validateEmail() so i should call setCookie( ) in validateForm ( ) after validateEmail( ) returns. does that sounds right?