开发者

Adding a radio button dynamically using Jquery (Onclick of a button)

I ve one dropdownlist & t开发者_如何学JAVAwo 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.

    function Contact_OnAddTelephone() {
    var type = $("#rdoTelephoneType").val();
    var areaCode = $("#txtAreaCode").val();
    var number = $("#txtNumber").val();

    var radio = $('<input>').attr({
        type: 'radio', id: 'rdoTelePrimary', name: 'rdoTelePrimary'
    });
    $('#tableTelephone tr:last').after("<tr><td>" + type + "</td><td>" + areaCode + "-" + number + "</td><td>" + radio[0].outerHTML + "</td></tr>");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜