First, excuse my bad english. Question, How will a set more values from different fields in this cookie? and how will i use document.write to display the cookie
<script language=”JavaScript”>
var theForm = document.forms[‘h_PageUI’];
</script>
<script language=”JavaScript”>
<!–
function HTMLOnLoadHandlerCallback(theForm)
{
var nameOfCookie = “COMPANY”;
alert(document.cookie.length)
if (document.cookie.length > 0){
begin = document.cookie.indexOf(nameOfCookie+”=”);
alert(“begin”+ begin)
if (begin != -1){
begin += nameOfCookie.length+1;
end = document.cookie.indexOf(“;”, begin);
if (end == -1) end = document.cookie.length;
//return unescape(document.cookie.substring(begin, end));
alert(unescape(document.cookie.substring(begin, end)))
}
}
return null;
}
function OnSubmitHandlerCallback(theForm)
{
var ExpireDate = new Date ();
// Field to set
var value = theForm.betforetag.value;
expiredays = 10;
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24
path = “/”;
document.cookie = “COMPANY” + “=” + escape(value) + ((expiredays == null) ? “” : “; expires=” + ExpireDate.toGMTString())+ “;Path=” + path;
</script>