How do I get the selected value of a select?
HTML:
<select data-bind="options: customers, optionsText: 'customer_display_name', optionsValue: 'customer_id'"></select>
Javascript:
var customers = <?php echo json_encode($this->customers); ?>;
self.customers = ko.mapping.fromJS(customers);
How can I access the currently selected "optionsText" or "optionsValue" inside my ViewModel?
self.customers...?
customer_id
so you would use that. – Jason Spake