Skip to content
Advertisement

radio and select option with alert

how do i show alert if no radio button selected form two radio button and after that show alert on select option if not selected. but I am getting alert on both radio button how do I fix it

JavaScript
JavaScript

Advertisement

Answer

The problem is that in your case, the 2 if statements regarding your radio buttons will always be false for one of the cases.

So do it like this.

JavaScript

Demo

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement