Skip to content
Advertisement

laravel foreach input radiobutton displayed incorrectly

I’m trying to display the options for the questions. i have the problem that when im doing it this way:

JavaScript

i can check all radio buttons at the same time but if i put there a name for the radiobutton i can check only one of the options for the whole questions.. i think there’s something strange with the foreach loop..

Info: the table “questions” has the following rows: id, category_id, question_text, correct_answer, option_text (this is a json-field that is casted to an array)

Code from Controller:

JavaScript

do you have an idea how to fix this? thank you!

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement