Hello Everyone!!
- I have a page English & French
-
I want my visitors once they select ENGLISH on the radio button to remember that whenever they visit my site.
> I do have the
javascript code 100% right but I'm
not sure how to store in the cookie when someone clicks the radio button.
HTML File that I tested but didn't work...PLEASE HELPPPP!!!

----------
<body onload="checkCookie
()">
<form id="c_name">
<input type="radio" name="choice" value="
languageEN" onClick="location.href='
en.html'">English<br />
<input type="radio" name="choice" value="
languageFR" onClick="location.href='
fr.html'">French<br />
</form>
-----------------
/*
JAVA SCRIPT FILE (100% correct)*/
function setCookie(c_name,value,expiredays,path) {
var exdate = new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie = c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires=" +exdate) + ((path==null) ? "" : ";path=" +path);
}
function checkCookies(c_name) {
var value = "";
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";",c_start);
if (c_end == -1) c_end = document.cookie.length;
value = unescape(document.cookie.substring(c_start,c_end)) ;
if (value == "
languageFR") window.location = "/fr.html";
else window.location = "/en.html";
}
}
}
--------------------------
function switchLang() {
var url = document.location.href;
if (url.indexOf("en.html") != -1) {
setCookie('
helloooo','
languageFR', 365,'/');
window.location = url.replace(/en.html/, "fr.html");
}
if (url.indexOf("fr.html") != -1) {
setCookie('
helloooo','
languageEN', 365,'/');
}
}