Click here to Skip to main content
15,886,049 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working on a project where the admin need to create questionnaire.When the user answer the questionnaire, they need to give details whenever they click on 'yes' radio button.

I need help to show another textfield only when the user click on yes radio button. The label for radio button is read from database which carry the same id for both radio button and both label are save in the same column in database.

can someone help me on how to show another text field

What I have tried:

here is the code on how i call the radio button from the database...

@elseif($question->question_type === 'radio')
                  @foreach($question->option_name as $keyr)
                    <p style="margin:0px; padding:0px;">
                      <input name="{{ $question->id }}[answer]" type="radio" id="{{ $keyq }}{{ $keyr }}" 
                      value={{$keyr}} />
                      <label for="{{ $keyq }}{{ $keyr }}" >{{ $keyr }}</label>
                    </p>
Posted
Updated 20-Feb-18 20:03pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900