hiddenタグ


hiddenタグを使って、他のformのパラメータを送信する。


記事へ戻る --- 愚鈍人ホーム
JavaScriptの参考書 /  Ajaxの参考書 /  HTMLの参考書 /  CSSの参考書

 


htmlソース

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>hiddenタグ</title>
<link href="/gudon/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function form1_onsubmit(form){
		form.hidden1.value=document.other_form.textbox1.value;
		return true;
	}
</script>
</head>
<body>
<h1>hiddenタグ</h1>
<hr />
<p>hiddenタグを使って、他のformのパラメータを送信する。</p>
<form name="form1" action="test1.php" onsubmit="form1_onsubmit(this);">
	<input type="hidden" name="hidden1">
	<input name="submitButton" type="submit" value="submitボタン"/>
</form>
<form name="other_form">
	<input name="textbox1" type="text" value="他のフォームのテキストボックスの値"/>
</form>
</body>
</html>