I am new to knockout and have been playing with the Cart example here
How would I go about assigning the value of the product dropdown on each line?. I want to be able to select the value of the selected item using JQuery and retain all the cart functionality. The code that is rendered is as follows:
<td>
<select class="form-control prodName" data-bind="options: $root.sampleProducts, optionsText: "name" , optionsCaption: "Select...", value: product">
<option value="">Select...</option>
<option value="">Standard (sandwich) </option>
<option value="">Premium (lobster)</option>
<option value="">Ultimate (whole zebra)</option>
</select>
</td>
No value??... But I want:
<td>
<select class="form-control prodName" data-bind="options: $root.sampleProducts, optionsText: "name" , optionsCaption: "Select...", value: product">
<option value="">Select...</option>
<option value="1">Standard (sandwich)</option>
<option value="2">Premium (lobster)</option>
<option value="3">Ultimate (whole zebra)</option>
</select>
</td>
The values are rendered, I have used optionsValue but that just causes the cart to break..