Skip to content

Validation needed for empty values as well. #1

Description

@sheikhrasik

The radio buttons take empty values as well, we can easily move to a next choice without choosing an option for a particular question. This is the validation i prescribe for the issue.

const submitQuiz = () => { const optionInputs = document.querySelectorAll(".options"); optionInputs.forEach((input)=>{ if(!input.checked){ alert("Please select your choice."); } else{ const data = questions[index]; const ans = getAnswer(); if (ans == data.correct) { correct++; } else { incorrect++; } index++; loadQuestion(); } }); };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions