I am trying to create a list of radio buttons with shortcuts so that you can click the label to check the radio element. That works fine for me in Chrome, but not in IE7. The HTML that spits out seems correct, but when I click on the label, the corresponding radio button is not selected.
Javascript
function ReuqestType(id, name, billable) { this.id = id; this.name = name; this.billable = billable; } function RequestViewModel() { var self = this; self.availableRequestTypes = [ new ReuqestType(1, "Travel", true), new ReuqestType(2, "Bill Only", false), new ReuqestType(3, "Both", true) ]; self.selectedRequestType = ko.observable(); }
HTML
Request Type <br /> <input type="radio" name="requestType" data-bind="value:id, attr: {'id': 'rt'+ id}" /> <label data-bind="text: name, attr:{'for':'rt'+id}"> </label>
What is the preferred way to do this?
source share