Skip to content
Advertisement

required not working

I’am using this code along with php code for a select and used required class to make it mandatory but it is not working. Does anyone can help me.I have included this html section along with php code.

 <select name="category" required="required" class="form-control">
        <option value=" ">--Select Category--</option>
        <option value="asd">asd</option>
    </select>

Advertisement

Answer

Try to remove space value in your select category option

<select name="category" required="required" class="form-control">
    <option value="">--Select Category--</option>
    <option value="asd">asd</option>
</select> code here
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement