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

回答編集履歴

2

修正

2019/11/26 08:31

投稿

退会済みユーザー
answer CHANGED
@@ -1,1 +1,60 @@
1
- form が 入れ子になってしまってますね。
1
+ form が 入れ子になってしまってますね。(しかも不完全に)
2
+
3
+ ```
4
+ <div class = "create_baby under_box">
5
+ <form action="/baby" method="post">
6
+ <div class="form-group">
7
+ <label for="name">おなまえ</label>
8
+ <input type="text" class="form-control" name="name">
9
+ </div>
10
+ <div class="form-group">
11
+ <label for="price">お誕生日</label>
12
+ <input type="text" class="form-control" name="birthday">
13
+ </div>
14
+ <div class="form-group">
15
+ <label for="price">写真</label>
16
+ <form method="post" action="{{ action('BabiesController@store') }}" enctype="multipart/form-data">
17
+ {{ csrf_field() }}
18
+ <fieldset>
19
+ <div>
20
+ <input id="file" type="file" name="image">
21
+ @if ($errors->has('image'))
22
+ {{ $errors->first('image') }}
23
+ @endif
24
+ </div>
25
+ </fieldset>
26
+ </div>
27
+ <button type="submit" class="btn btn-default">登録</button>
28
+ <a href="/baby">戻る</a>
29
+ </form>
30
+ </div>
31
+ ```
32
+
33
+ ```
34
+ <div class = "create_baby under_box">
35
+ <form method="post" action="{{ action('BabiesController@store') }}" enctype="multipart/form-data">
36
+ <div class="form-group">
37
+ <label for="name">おなまえ</label>
38
+ <input type="text" class="form-control" name="name">
39
+ </div>
40
+ <div class="form-group">
41
+ <label for="price">お誕生日</label>
42
+ <input type="text" class="form-control" name="birthday">
43
+ </div>
44
+ <div class="form-group">
45
+ <label for="price">写真</label>
46
+ {{ csrf_field() }}
47
+ <fieldset>
48
+ <div>
49
+ <input id="file" type="file" name="image">
50
+ @if ($errors->has('image'))
51
+ {{ $errors->first('image') }}
52
+ @endif
53
+ </div>
54
+ </fieldset>
55
+ </div>
56
+ <button type="submit" class="btn btn-default">登録</button>
57
+ <a href="/baby">戻る</a>
58
+ </form>
59
+ </div>
60
+ ```

1

修正

2019/11/26 08:31

投稿

退会済みユーザー
answer CHANGED
@@ -1,8 +1,1 @@
1
- ```html
2
- <form action="/baby" method="post">
1
+ form 入れ子になってしまってますね。
3
- ```
4
-
5
-
6
- ```html
7
- <form action="/baby" method="post" enctype="multipart/form-data">
8
- ```