I would like to show a radio button, have its value submitted, but depending on the circumstances, have it not editable. Disabled doesn\'t work, because it doesn\'t submit t
JavaScript way - this worked for me.
Reason:
$('#YourTableId').find('*') -> this returns all the tags.
$('#YourTableId').find('*').each(function () { $(this).attr("disabled", true); });
iterates over all objects captured in this and disable input tags.
Analysis (Debugging):
form:radiobutton is internally considered as an "input" tag.
Like in the above function(), if you try printing document.write(this.tagName);
Wherever, in tags it finds radio buttons, it returns an input tag.
So, above code line can be more optimized for radio button tags, by replacing * with input:
$('#YourTableId').find('input').each(function () { $(this).attr("disabled", true); });