I have the following in the code :
$form['location'] = array(
'#value' => '<select name="location">
<option value="778">Location1 </option>
<option value="779">Location2 </option>
<option value="780">Location3 </option>
<option value="781">Location4 </option>
</select>',
);
In the submit function how do I access the value that was selected in the select box?
$form_state['values']['location'] does not work 🙁
That’s not how you do it in Drupal. Read this before trying to create a form in Drupal
That’s how a select element should look like: