Radiobutton unchecks Checkbox in the same table row
I render a table using javascript that has a checkbox and a radiobutton on each row of data. Here is a snippet of the code that renders the radiobutton and checkbox.
htmlResult += '<td><input type="checkbox" name="checkBoxes" class="selectLink" id="chkbxRow' + rowCounter + '"style="vertical-align: sub;"/></td>';
htmlResult += '<td><input type="radio" name="isLoanRecipient" value="' + rowCounter + '" id="radioRow' + rowCounter + '"style="vertical-align: sub;"/></td>';
The table is displayed however when I click on the radiobutton, if the checkbox on the same row is previously checked, it unchecks it. Did anyone encountered the same problem? Does anyone know what might be the cause of this? Thanks.
By the way,开发者_如何学JAVA I'm referencing jquery scripts(1.5.1, validate, validate.unobtrusive, ui)
maybe the solution is simply to insert a space:
id="chkbxRow' + rowCounter + '"style="vertical-align: sub;"
id="chkbxRow' + rowCounter + '" style="vertical-align: sub;"
The same would go for the line with the radios.
精彩评论