0

How do make it required you have to check a answer?

He! I'm making a quiz with html and javascript. But I ran in to a problem: How do I make it required that you have to check a answer. And then you are allowed to press next. So you can't continue to the next question if you didn't fill in a answer. I tried to add required at the end in the radio button input but that doesn't work unfortunately. https://jsfiddle.net/deorka12/rtyk1mse/ or ( on fiddle the code works better) https://code.sololearn.com/WWPaUoFQvFjr/#html I hope somebody has some tips/ideas/answers!

21st Jan 2019, 9:09 PM
Marijn
3 Respuestas
+ 1
Is not letting me see the code,so this may not be an accurate suggestion,but. Did you try by adding a script with an IF code and set it with the condition that if your radio input is null have an alert saying that it needs to be filled?
21st Jan 2019, 9:38 PM
Alandec
+ 1
padd a condition to the next button..if radio button = false to either not work or give an error message saying please choose an answer to continue. id help with the code but jsfiddle unreadable on my phone
22nd Jan 2019, 5:48 AM
Jason Kennedy
0
Thanks for the feedback! Here is another link: https://code.sololearn.com/WWPaUoFQvFjr
22nd Jan 2019, 7:16 AM
Marijn