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

質問編集履歴

4

form2 input name 修正

2019/10/31 04:21

投稿

span
span

スコア32

title CHANGED
File without changes
body CHANGED
@@ -7,9 +7,9 @@
7
7
  </form>
8
8
 
9
9
  <form id="form2" action="hogehoge" method="post">
10
- <input type="text" name="hoge2" value="data2-1">
10
+ <input type="text" name="huga1" value="data2-1">
11
- <input type="text" name="hoge2" value="data2-2">
11
+ <input type="text" name="huga2" value="data2-2">
12
- <input type="text" name="hoge2" value="data2-3">
12
+ <input type="text" name="huga3" value="data2-3">
13
13
  <input type="submit" value="送信">
14
14
  </form>
15
15
  ```

3

form2 input type 変更

2019/10/31 04:21

投稿

span
span

スコア32

title CHANGED
File without changes
body CHANGED
@@ -7,9 +7,9 @@
7
7
  </form>
8
8
 
9
9
  <form id="form2" action="hogehoge" method="post">
10
- <input type="checkbox" name="hoge2" value="data2-1">
10
+ <input type="text" name="hoge2" value="data2-1">
11
- <input type="checkbox" name="hoge2" value="data2-2">
11
+ <input type="text" name="hoge2" value="data2-2">
12
- <input type="checkbox" name="hoge2" value="data2-3">
12
+ <input type="text" name="hoge2" value="data2-3">
13
13
  <input type="submit" value="送信">
14
14
  </form>
15
15
  ```

2

nameを配列へ

2019/10/31 04:14

投稿

span
span

スコア32

title CHANGED
File without changes
body CHANGED
@@ -1,8 +1,8 @@
1
1
  ```html
2
2
  <form id="form1">
3
- <input type="checkbox" name="hoge1" value="data1-1">
3
+ <input type="checkbox" name="hoge[]" value="data1-1">
4
- <input type="checkbox" name="hoge1" value="data1-2">
4
+ <input type="checkbox" name="hoge[]" value="data1-2">
5
- <input type="checkbox" name="hoge1" value="data1-3">
5
+ <input type="checkbox" name="hoge[]" value="data1-3">
6
6
  <div id="getData">GET</div>
7
7
  </form>
8
8
 

1

2019/10/31 04:08

投稿

span
span

スコア32

title CHANGED
File without changes
body CHANGED
@@ -15,5 +15,6 @@
15
15
  ```
16
16
 
17
17
  上記のイメージでform1のチェックボックス選択で取得した結果valueをform2に渡してsubmitしたいと考えています。
18
- このような実装はかのうでしょうか?
18
+ このような実装は可能でしょうか?色々と調べたのですが解決に至らず質問させていただきます。
19
+ 解決に至るscript等ありましたら
19
- 申し訳ありませんがご教授ねがいます。
20
+ 申し訳ありませんがご教授います。