119
113

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

フォームのボタンでaction先を変更するときのベストプラクティス

119
Last updated at Posted at 2015-07-25

この記事は個人ブログに移行しました。最新情報はブログ版をご覧ください。

要点

  • jsは汎用的に。 — javascript
  • HTMLはこんな感じ。 — html + data-actionに遷移先URLを設定 + class="submit"を付与することでjsが起動します ※formのactionはjsで書き換えられるので何でもOKかと。 ステキです。
  • 毎回どう実装しようか迷うので これからは下記で統一しようと思います。

もっと詳しく

  • ブログではコード全文や補足資料を継続的に更新しています
  • 気になる点があればコメントください🙌
119
113
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
119
113

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?