REGISTER FREE to Receive Instant Job

Tuesday, 11 December 2012

Saving Form Values using Cookies

Saving Form Values using Cookies

<!--cookies.js page start here-->

function FormValueWriteInCookie()
{
var definecookievariable="FormInputName="+ document.getElementById("FormInputID").value+":FormInputName2="+document.getElementById("FormInputID2").value+":; expires=Mon, 14 July 2020 00:00:00";

document.cookie=definecookievariable;

}

function ReadFormValueFromCookie()
{


cookiearray = allcookies.split(":");


if(cookiearray[0].split("=")[0]=="FormInputName"){

value =cookiearray[0].split("=")[1];
document.getElementById("FormInputID").value=value;

}


if(cookiearray[1].split("=")[0]=="FormInputName2"){

value1 =cookiearray[1].split("=")[1];

document.getElementById("FormInputID2").value=value1;
}
}

<!--cookies.js page ends here-->



0 comments:

Post a Comment

Popular Posts

Powered by Blogger.

About Me

My photo

JobsAcid is a 'job search engine' to provide finding a job on the internet easier for the user. It has designed as huge selection of job offerings on the same search engine.