■フォームの設定を参照、変更したい


お名前:

ご要望:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>フォームの設定を参照、変更したい</title>
<script type="text/JavaScript">
<!--
function frm_disp(){
alert("document.forms.length = "+document.forms.length+"\n"+
"document.frm1.action = "+document.fm1.action+"\n"+
"document.frm1.method = "+document.fm1.method+"\n"+
"document.frm1.encoding = "+document.fm1.encoding);
}
function frm_chg() {
document.fm1.action = "http://XXX.XXX.XXX/cgi-bin/XXX.cgi";
document.fm1.method = "get";
document.fm1.encoding = "application/x-www-form-urlencoded";
}
// -->
</script>
</head>
<body>
<p>■フォームの設定を参照、変更したい</p>
<form name="operation">
<p><input type="button" value="フォームの設定を表示" onclick="frm_disp()">
<input type="button" value="フォームの設定を変更" onclick="frm_chg()"></p>
</form>

<hr>
<form name="fm1" action="mailto:tateda-yoshio@nifty.com" subject=test_site:demand_mail" method="post" enctype="text/plain">
<p>お名前:<input type="text" name="name" value="" size="50"></p>
<p>ご要望:<textarea name="demand" rows="3" cols="40"></textarea></p>
<p><input type="submit" value="送信"> <input type="reset" value="リセット"></p>
</form>

</body>
</html>


★解説★