I have created a form page using JSP. I have to get user login details and user password. I wrote JS to validate user name and password and I want the user to check the radio button to check the respective department. But When he not choose the radio button the message box displays and after it forwards to another empty page where it should not forward and it should remain in the same page. Help me to solve this problem and how to check and validate the radio button.
User Login page
JSP code
JS to validate radio button
User Login page
JSP code
JS to validate radio button
if(document.studentlogin.dept.checked==true)
{ alert("Select the department");
return false;
} return true;
}
1