I am dynamically populating a drop down in my form with data from a database.
This drop down is required.
I would like for the the First Choice in the drop down to be Choose with a value of null so that it forces the user to use the drop down and choose an option. If they leave it on Choose then then should get the This is Required notice. How to go about this?
My code to populate the drop down:
#Populate the Project Dropdown List
function project_dynamic_dropdown_values($form) { $options = array(); $dbc = mysqli_connect('localhost', 'xxx', 'xxx', 'xxx'); $query = "SELECT * FROM projects ORDER BY description ASC"; $result = mysqli_query($dbc, $query);