HTML <input> formaction属性
例
アクションが異なる2つの送信ボタンがあるHTMLフォーム:
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input
type="submit" value="Submit">
<input type="submit" formaction="/action_page2.php"
value="Submit to another page">
</form>
定義と使用法
このformaction
属性は、フォームの送信時に入力コントロールを処理するファイルのURLを指定します。
この属性は、要素formaction
の属性をオーバーライドします。action
<form>
注:formaction
属性はおよびで使用さ
type="submit"
れますtype="image"
。
ブラウザのサポート
表の数字は、属性を完全にサポートする最初のブラウザーバージョンを示しています。
Attribute | |||||
---|---|---|---|---|---|
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
構文
<input formaction="URL">
属性値
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted. Possible values:
|
❮HTML<input>タグ