0
내 컨트롤러 코드 :foreach 루프의 각 라디오 버튼의 값을 가져
$model = customer::all(); return View::make('admin.test.startTest') ->with('title','Question and answer') ->with('data',$model);
이 내보기 코드 :
foreach($data as $value) { ?> <p>{{ $value-> Qid }}) {{ $value-> opt }} </p> <?php if(($value ->QuestionType) == "MCQ") {?> <ul> <li><b>A: </b>{{$value->opt1}}</li> <li><b>B: </b>{{$value->opt2}}</li> <li><b>C: </b>{{$value->opt3}}</li> <li><b>D: </b>{{$value->opt4}}</li> </ul> Select one of the following options:<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="A" ">{{ $value->opt1}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="B" ">{{ $value->opt2}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="C" ">{{ $value->opt3}}<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="D" ">{{ $value->opt4}}<br> <?php } elseif(($value ->QuestionType) == "truefalse") {?> Select one of the following options:<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="true" ">True<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="false" ">False<br> <?php } else {?> <input type="radio" name="answers[{{ $value-> opt }}]" value="ok" ">OK<br> <input type="radio" name="answers[{{ $value-> opt }}]" value="agree" ">Agree<br>
- 내가 laravel를 사용했다
- 내가 모든 값이
- 는 어떻게 입력 필드의 값을 얻을 수있는 결과와 비교 싶어 데이터베이스에서 데이터를 검색
- for 루프의 입력 필드 a
어디에서 입력 필드 값을 얻을 수 있습니까?
문제는 내가 값이 표시되는 각 루프에서 라디오 버튼을 넣어 왔지만되어 선택된 값