HTML5|ボタンごとにフォームの遷移先URLを変更する
スポンサーリンク
ボタンごとにフォームの遷移先URLを変更する
戻るボタンがあるなど、ボタンごとにフォームの遷移先URLを変える方法です。
ボタンタグのformaction属性をつけると、formタグのactionを上書きする動作をします。
<form action="save.html" method="post"> <button type="submit">保存</button> <button type="submit" formaction="index.html">保存しないで戻る</button> </form>
更新日:2018年10月06日
作成日:2018年10月06日