クッキーで前回のフォーム内容を入力します(現在の有効期限は2日です)。
Name

Telephone - -
Email


<HTML>
<HEAD>
<TITLE>Sopping_suport</TITLE>
<SCRIPT TYPE="text/javascript">
<!--
function Init(){
var c_email = getCookie("email"); if(c_email != ""){ var c_name1 = getCookie("name1"); var c_name2 = getCookie("name2"); var c_tel1 = getCookie(">tel1"); var c_tel2 = getCookie("tel2"); var c_tel3 = getCookie("tel3"); document.myForm.name1.value = c_name1; document.myForm.name2.value = c_name2; document.myForm.tel1.value = c_tel1; document.myForm.tel2.value = c_tel2; document.myForm.tel3.value = c_tel3; document.myForm.email.value = c_email; } } function f_submit(){ setCookie("name1",document.myForm.name1.value); setCookie("name2",document.myForm.name2.value); setCookie("tel1",document.myForm.tel1.value); setCookie("tel2",document.myForm.tel2.value); setCookie("tel3",document.myForm.tel3.value); setCookie("email",document.myForm.email.value); document.myForm.submit(); } function getCookie(key){ tmp = document.cookie+";"; tmp1 = tmp.indexOf(key,0); if(tmp1 != -1){ tmp = tmp.substring(tmp1,tmp.length); start = tmp.indexOf("=",0) + 1; end = tmp.indexOf(";",start); return(unescape(tmp.substring(start,end))); } return(""); } function setCookie(key,val){ var expiresDate = new Date(); //Limit = second * minute * hour * day * 1000 expiresDate.setTime(expiresDate.getTime() + 60 * 60 * 24 * 2 * 1000); tmp = key + "=" + escape(val) + "; "; tmp += "expires="; tmp += expiresDate.toGMTString(); document.cookie = tmp; } //--> </SCRIPT>
</HEAD> <BODY onLoad="Init()"> <FORM NAME="myForm" METHOD="post" ACTION="***.cgi"> <TABLE WIDTH="480" BORDER="0" CELLSPACING="2" CELLPADDING="2"> <TR> <TD BGCOLOR="#CCCCCC" ALIGN="RIGHT">Name</TD> <TD NOWRAP BGCOLOR="#EEEEEE"> <P> <INPUT TYPE="text" NAME="name1" SIZE="15"> <INPUT TYPE="text" NAME="name2" SIZE="15"> </P> </TD> </TR> <TR> <TD ALIGN="RIGHT" BGCOLOR="#EEEEEE">Telephone</TD> <TD BGCOLOR="#CCCCCC"> <INPUT TYPE="text" NAME="tel1" SIZE="8"> - <INPUT TYPE="text" NAME="tel2" SIZE="8"> - <INPUT TYPE="text" NAME="tel3" SIZE="10"> </TD> </TR> <TR> <TD BGCOLOR="#CCCCCC" ALIGN="RIGHT">Email</TD> <TD BGCOLOR="#EEEEEE"> <INPUT TYPE="text" NAME="email" SIZE="30"> </TD> </TR> <TR ALIGN="CENTER"> <TD COLSPAN="2"> <HR SIZE="1" NOSHADE> <INPUT TYPE="button" VALUE="SUBMIT" onClick="f_submit()"> <INPUT TYPE="reset" VALUE="RESET"> </TD> </TR> </TABLE> </FORM> </BODY> </HTML>

BACK