I ve one dropdownlist & two textboxes. Once I fill them, (on click of a button) I want to append them in a table row dynamically along with a radio button as the third column.
The below code is working, but not sure why the onclick event of radio button is not responding. I am using MVC 3.0.
I ve noticed that onclick event is still working, but the clicked radio button is not getting checked, keeping other radio buttons unchecked.
function Contact_OnAddTelephone() {
var type = $("#rdoTelephoneType").val();
var areaCode = $("#txtAreaCode").val();
var radio = $('<input>').attr({
type: 'radio', id: 'rdoTelePrimary', name: 'rdoTelePrimary', onclick: 'alert("a");this.checked'
});
$('#tableTelephone tr:last').after("<tr><td>" + type + "</td><td>" + areaCode + "-" + number + "</td><td>" + radio[0].outerHTML + "</td></tr>");
}
Here on click still I can see the alert getting fired, but this.checked is not working