How can I set the value of an <input> to false? true works fine.
Model:
function Model(){
self = this;
self.Test = ko.observable(false);
};
HTML:
<input type="text" data-bind="value:Test"/>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
<input type="text">expects a text value, and you’re supplying a boolean.The boolean value
falseis considering “falsey” when passed in the value attribute, which is the same as supplying no value, so it appears blank.It works for
truebecause you end up withtrue.toString()