ラジオボタンをグループ別で保存したい
現状のテンプレート
blade
1@extends('layouts.app') 2 3@section('content') 4<div class="container"> 5 <div class="row justify-content-center"> 6 <div class="col-md-12"> 7 <div class="card"> 8 <div class="card-header">マイページ</div> 9 10 <div class="card-body"> 11 <form class="form-horizontal mypage_form" role="form" method="POST" action="{{ url('/user/profile') }}"> 12 {!! csrf_field() !!} 13 14 <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}"> 15 <label class="col-md-4 control-label">名前</label> 16 17 <div class="col-md-12"> 18 <input type="text" class="form-control" name="name" value="{{ old('name', $user->name) }}"> 19 20 @if ($errors->has('name')) 21 <span class="help-block"> 22 <strong>{{ $errors->first('name') }}</strong> 23 </span> 24 @endif 25 </div> 26 </div> 27 28 <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> 29 <label class="col-md-4 control-label">Eメール</label> 30 31 <div class="col-md-12"> 32 <input type="email" class="form-control" name="email" value="{{ old('email', $user->email) }}"> 33 34 @if ($errors->has('email')) 35 <span class="help-block"> 36 <strong>{{ $errors->first('email') }}</strong> 37 </span> 38 @endif 39 </div> 40 </div> 41 <div class="form-group"> 42 <label class="col-md-4 control-label">アラート設定</label> 43 <div class="col-md-12"> 44 <label class="alert_label">USD/JPY</label> 45 <label><input type="radio" value="1" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 1) checked @endif>有効</label> 46 <label><input type="radio" value="0" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 0) checked @endif>無効</label> 47 </div> 48 <div class="col-md-12"> 49 <label class="alert_label">EUR/JPY</label> 50 <label><input type="radio" value="1" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 1) checked @endif>有効</label> 51 <label><input type="radio" value="0" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 0) checked @endif>無効</label> 52 </div> 53 <div class="col-md-12"> 54 <label class="alert_label">GBP/JPY</label> 55 <label><input type="radio" value="1" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 1) checked @endif>有効</label> 56 <label><input type="radio" value="0" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 0) checked @endif>無効</label> 57 </div> 58 <div class="col-md-12"> 59 <label class="alert_label">EUR/USD</label> 60 <label><input type="radio" value="1" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 1) checked @endif>有効</label> 61 <label><input type="radio" value="0" name="usdjpy_alert" @if (old('usdjpy_alert', $user->usdjpy_alert) == 0) checked @endif>無効</label> 62 </div> 63 </div> 64 <div class="form-group"> 65 <label class="col-md-4 control-label">pips設定</label> 66 <div class="col-md-12"> 67 <label>USD/JPY</label> 68 <input type="text" class="form-control" name="usdjpy_pips" value="{{ old('usdjpy_pips', $user->usdjpy_pips) }}"> 69 </div> 70 </div> 71 72 73 <div class="form-group"> 74 <div class="col-md-12 col-md-offset-4"> 75 <button type="submit" class="btn btn-primary"> 76 保存 77 </button> 78 </div> 79 </div> 80 </form> 81 </div> 82 </div> 83 </div> 84 </div> 85</div> 86@endsection
上記のようにすると1つのグループになってしまい
各項目が設定できない
formを各グループ毎に設定してみたが保存が出来なくなってしまった
上記のテンプレートを個別のグループにする方法はどうすればよいでしょうか??
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/10 00:08