

#
“formaction”属性について
“formaction”属性は“type="submit"”を指定した“button”要素でフォームを送信したときの入力された内容の送信先を指定します。
通常フォームに入力されたデータを処理するPHPやCGIプログラムを送信先として指定します。値となるURLは相対パスや絶対パスで指定することができます。
多くの場合、フォームへ入力された内容の送信先は“form”要素の“action”属性で指定されますが、“button”要素に“formaction”属性を指定した場合はボタンごとに別の送信先を指定することができます。
“form”要素に“action”属性が指定されている場合は“formaction”属性の値が優先されます。
#
#
サンプルコード
<form method="post" target="_blank">
<fieldset>
<legend>好きな果物</legend>
<p>
<label><input type="checkbox" name="fruit[]" value="甘蕉">甘蕉</label>
<label><input type="checkbox" name="fruit[]" value="林檎">林檎</label>
<label><input type="checkbox" name="fruit[]" value="甜瓜">甜瓜</label>
<label><input type="checkbox" name="fruit[]" value="苺">苺</label>
<label><input type="checkbox" name="fruit[]" value="桃">桃</label>
</p>
</fieldset>
<fieldset>
<legend>一番好きな果物</legend>
<p>
<label><input type="radio" name="no1fruit" value="甘蕉">甘蕉</label>
<label><input type="radio" name="no1fruit" value="林檎">林檎</label>
<label><input type="radio" name="no1fruit" value="甜瓜">甜瓜</label>
<label><input type="radio" name="no1fruit" value="苺">苺</label>
<label><input type="radio" name="no1fruit" value="桃">桃</label>
</p>
</fieldset>
<fieldset>
<legend>あなたの情報</legend>
<p><label>居住地域:<input type="text" name="area"></label></p>
<p><label>年齢:<input type="number" name="age"></label></p>
</fieldset>
<p>
<button type="submit" formaction="sample-formtag2.php">送信する</button>
<button type="reset">やり直す</button>
</p>
</form>