How to validate a form using HTML5 and CSS

dj222

New Member
I coded a form that can post information to another page where it is processed. I wanted to ask users if there are options that were not selected. My form looks like this:\[code\]<form action="answers-of-brain-teaser-questions.php" method="post"><div><div>Question 1</div><input name="q1" type="radio" value="http://stackoverflow.com/questions/15598953/1">A. 1<br /><input name="q1" type="radio" value="http://stackoverflow.com/questions/15598953/2">B. 4<br /><input name="q1" type="radio" value="http://stackoverflow.com/questions/15598953/3">C. 3<br /><input name="q1" type="radio" value="http://stackoverflow.com/questions/15598953/4">D. 2</div><div><div id="question">Question 2</div><input name="q2" type="radio" value="http://stackoverflow.com/questions/15598953/5">A. 1<br /><input name="q2" type="radio" value="http://stackoverflow.com/questions/15598953/6">B. 2<br /><input name="q2" type="radio" value="http://stackoverflow.com/questions/15598953/7">C. 3<br /><input name="q2" type="radio" value="http://stackoverflow.com/questions/15598953/8">D. 4</div></form>\[/code\]How can I show users a message if some radio buttons are clicked. I only want to show a message if a question has no selected answer (no radio button is selected). For example, if no option is selected for question 2.
 
Back
Top