html I have a radio button with required but it does not show me the alert that the field was emptied

0

           Protected

       <input type="radio" name="seguro" id="desgravamen" class="formulario__input " >
        <label for="desgravamen">Desgravamen</label>

        </div>

        <input type="submit" name="submit" class="formulario__submit" action="controlador" id="ap">
    
asked by Nicolas Flores Muñoz 07.11.2018 в 02:44
source

1 answer

1

In order to validate the "required" property, it must be inside a form. In this way, when executing the submit, it executes the validation of all its fields. Greetings!

<form>
<input type="checkbox" required>Check required
<button type="submit">Submit</button>
</form>
    
answered by 07.11.2018 / 04:02
source