I need to save the user selected text to the db.I tried 3 different ways but all of them return null for the selected value. value1 or value2 or value3 returns null. What I am doing to wrong here ?
<div id="reasonsList" style="display: none">
@foreach (var reason in Model.CorrectionReasonsList)
{
<option>@(reason)</option>
}
</div>
var value = '<option selected="selected" value="' + sData + '">' + sData + '</option>';
var reasonsSelect = '<select id="correction_reason_dropdown" ' +
'multiple ' +
'style="min-width:115px" ' +
'data-select-options={"searchField":"false","noValueText":"Select One"))"} ' +
'class="select multiple-as-single compact correction-reason" ' +
'>';
reasonsSelect += value + $("#reasonsList").html();
reasonsSelect += "</select>";
$(nTd).html(reasonsSelect);
var value1 = $('#reasonsList:selected').val();
var value2 = $('#reasonsList:selected').find('option:selected').text();
var value3 = $('#reasonsList:selected').text();