teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

2021/12/03 18:22

投稿

meron88
meron88

スコア50

title CHANGED
File without changes
body CHANGED
@@ -2,33 +2,6 @@
2
2
  laravelのbladeで削除のチェックボックスがtrueの場合にformタグのaction属性の値を変更したいのですが下記のやり方だと出来ないのですが、どうすれば実現可能でしょうか?
3
3
  よろしくお願いいたします。
4
4
 
5
-
6
- ### 該当のソースコード
7
-
8
- ```ここに言語名を入力
9
- <div>
10
- <form method="POST" action="{{ route('menu.update', $menus->code)}}">
11
- <label>削除する場合チェック</label>
12
- <input type="checkbox" id="isDelete">
13
- <label>削除</label>
14
- <button onclick="deleteEvent()">保存</button>
15
- </form>
16
- </div>
17
- @push('scripts')
18
- <script>
19
- function deleteEvent() {
20
- const checkFlg = document.getElementById('isDelete').checked
21
- const inputForm = document.getElementById('inputForm')
22
- if (!checkFlg) {
23
- return
24
- }
25
- inputForm.action = "{{ route('menu.delete', $menus->code)}}"
26
- }
27
- </script>
28
- @endpush
29
-
30
- ```
31
-
32
5
  ### 補足情報(FW/ツールのバージョンなど)
33
6
 
34
7
  laravel8