Reputation: 8568
I am new in javascript and I am currently researching the knockoutjs library. Here is my question. I have a select list populated from an observable array. When I select a value from the select list and click the save button, I want this value to be saved in a variable which later I will send to the server. How can this be done? Thank You!
Fiddle: http://jsfiddle.net/PsyComa/xuHkJ/1/
Upvotes: 2
Views: 5633
Reputation: 26730
The "knockout"-ish way would be to use the "value" binding:
<select data-bind="options: optionValues, value: selectedValue">
Upvotes: 7