Validation with inputs hidden by knockout
Hi all,
I can't figure out how to get the validation plugin to work at all with radio buttons that live inside a "ko if" conditional block.
The radio buttons need dynamic names (to work as groups), which I assign through their data-bind attribute; the name however doesn't get assigned if the "ko if" is false, and jquery validation complains.
I have tried all combinations I could think of, suggestions would be really appreciated.
Thanks!
The html looks roughly like this:
- <form>
- <!-- ko foreach: myList -->
- <!-- ko if: myTest -->
- <input type="radio"
- data-rule-required="true"
- data-bind="attr: { name: 'isLead-' + id }, checked: isLead, checkedValue: 1"
- />Lead
- ... other similar radio ...
- <!-- /ko -->
- <!-- /ko -->
- </form>