-
Javascript stylesheet swap based on cookie
ok here's my issue.
i have a login page which remembers the inputted password in a cookie. once the login is successful, i need to dynamically load one of 2 stylesheets based on the password value in the cookie.
this is for a demo so i only need it to change between 2 stylesheets and i'm only using 2 possible passwords. seems like it's not that hard but my brain is fried. please help!!!
Kristiandavid
-
-
-
-
this makes the cookie :
function set_cookiePass(c_pass, form){
document.cookie=c_pass+"="+form.Password.value;
}
this is the sumbit button;
<input name="Submit" type="submit" value="Submit" onclick="set_cookiePass('password',this.form);MM_goToURL('parent','http://66.11.64.70/csp2/main2.html');return document.MM_returnValue" />
those work fine, now i just need to grab the cookie on the following page and based on the password value, change the stylesheet.
ie : if user enters 'pass1' as the password, the following page will load 'style1.css'
if user enters 'pass2' as the password, the following page will load 'style2.css'
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks