perfect code to validate at least one radio button is selected
call this function on on click event,in else the other function is called
Syntax:
JavaScript
function valbutton(form) { // place any other field validations that you require here // validate myradiobuttons myOption = -1; for (i=form.rbt_no.length-1; i>-1; i--) { if (form.rbt_no[i].checked) { myOption = i; i = -1; } } if (myOption == -1) { alert("You must select an option to proceed"); return false; } else { next_ques('next'); } html: onclick="<?php /*?>next_ques('next')<?php */?> valbutton(form);return false;"