■送信、リセットボタンを動作させたい


お名前:

ご要望:


<!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_submit(){
if(confirm("フォームを送信します。よろしいですか?")) {
document.fm1.submit();
} else {
alert("送信を中止しました。")
}
}
function frm_reset() {
if(confirm("フォームをリセットします。よろしいですか?")) {
document.fm1.reset();
}
}
// -->
</script>
</head>
<body>
<p>■送信、リセットボタンを動作させたい</p>
<form name="fm1" action="mailto:tateda-yoshio@nifty.com" method="post" enctype="text/plain">
<p><input type="button" value="送信動作をする" onclick="frm_submit()">
<input type="button" value="リセット動作をする" onclick="frm_reset()"></p>
<hr>
<p>お名前:<input type="text" name="name" value="" size="50"></p>
<p>ご要望:<textarea name="demand" rows="3" cols="40"></textarea></p>
</form>

</body>
</html>


★解説★