Reputation: 2850
In me site, I would have expected my form inputs to have the default text values but no such luck..
vm = { codeIncrementer: ko.mapping.fromJS({ fromNum: "1", toNum: "10", incrementerOutput: "", incrementerInput: "test code;<></" }) };
The vm var holds the correct values when I tryout putput them in the console..
Any ideas?
Upvotes: 0
Views: 33
Reputation: 3192
For input tags, use the value
binding rather than the text
binding.
<input type="text" data-bind="value: fromNum" ... />
instead of
<input type="text" data-bind="text: fromNum" ... />
Upvotes: 2