How to make selection box required to be selected?

Top  Previous  Next

The same way as for the other field types, you have to mention the name of this field as required_fields in config.php.

Example:

required_fields = department (Department)

Also you need to create option with blank value by default.

Example:

 

<select name="department">

<option value="" selected>Select...</option>

<option value="sales">Sales Department</option>

<option value="support">Support Department</option>

<option value="billing">Billing Department</option>

</select>