I have integrated knockout js in my project and now i am facing some issues in setting user selected values to Dropdown,
Code below:
<select id="regDobMonth" data-bind="options: RDOBM, optionsText: 'name', selectedOptions: selRDOBM" name="" class="date-sel month" tabindex="3"></select>
JS File :
RDOBY: ko.observableArray([{ name: "1986" }, { name: "1987" }, { name: "1988" }, { name: "1989" }, { name: "1990" }, { name: "1991" }, { name: "1992" }, { name: "1993" }, { name: "1994" }, { name: "1995" }, { name: "1996" }, { name: "1997" }, { name: "1998" }, { name: "1999" }, { name: "2000" }, { name: "2001" }]);
I am able to load these data to dropdown and able to select the selected values using ,
selRDOBY().name
But my problem is i want to set this value back to dropdown.
Eg: From backend system i am receiving 2010 as selected Year then i need to set this value to this dropdown.
How to do this. Any help is appreciated.