How can I set the option value of a drop-down list to the option selected by the user. I believe I need to use a script but I am unsure as to the best practice. The options are populated via JSON response. This functionality is needed for form submission.
<div class="select">
<select name="selectcompanies" id="selectcompanies">
<option value="">Company</option>
{% for company in companies %}
<option value="" name="selected_company" id="selected_company">{{ company.name }}</option>}
{% endfor %}
</select>
</div>