我希望“EnterTemplate”div
基于单选按钮有条件地可用。我text
在最底部添加了数据绑定以进行测试,它根据单选按钮的值向我返回“真”或“假”值。我正在尝试为visible
绑定分配此值,但没有任何反应。有什么建议么?
<div><h4>Select Instrument Template:</h4></div>
<div id="ChooseModel">
<strong>Would you like to manually insert number?</strong><br />
<input type="radio" name="ChooseModel" value="True" data-bind="checked: RadioOption"/>@Resx.Yes
<input type="radio" name="ChooseModel" value="False" data-bind="checked: RadioOption"/>@Resx.No
</div>
<div id="EnterTemplate" data-bind="visible: RadioOption">
<div><strong>Model Number: </strong></div>
<div><input data-bind="value: ModelNumberString" /></div>
<div><strong>Manufacturer: </strong></div>
<div><input data-bind="value: ManufacturerString" /></div>
<div>Model Number: <strong data-bind="text: ModelNumberString"></strong></div>
<div>Checked: <strong data-bind="text: RadioOption"></strong></div>
</div>