even that I see very many similar questions in this site, no one of them answer to my question. So pleas, don't be angry with me that I discuss this subject again. I work in durandal project, I have html pages with javascript files behind. I have two radio button in one of the pages. I want their "checked" attribute to be binding to a variable in the view-model behind. It is looked simple... but it is not! I try two ways, any one of them didn't succeed:
first-way: in the html:
<input type="radio"
name="radSearchBy"
id="byNo"
data-bind:"checked:isId" />
in javascript:
isId: ko.observable(true)
second-way: in the html:
in javascript:
isId: ko.observable("checked")
I know what is the problem. even if I simply write
<input type="radio"
name="radSearchBy"
id="byNo"
data-bind:"checked:true" />
or:
<input type="radio"
name="radSearchBy"
id="byNo"
checked="checked" />
it doesn't work. only whem I write:
<input type="radio"
name="radSearchBy"
id="byNo"
**checked** />
yes, the "checked" word without anything follow- it works well.
but it is problem, becouse how can I do it *binding?*
please help me as quick as you can.