javascript - Copy row doesn't work other ajax function -
i create copy row jquery append function , use add , remove button , there jquery mask phone input inside first row of table.
phone mask working first row not working copy row.
$(document).ready(function(){ var cnt = 2; $(".addcf").click(function(){ $("#customfields").append('<tr><td><input type="text" name="adsoyad[]" style="width:130px"/></td><td><input type="text" name="gorevi[]" style="width:130px"/></td><td><input type="text" id="phone" name="telefon[]" style="width:130px"/></td><td><input type="text" name="dahili[]" style="width:70px"/></td> <td><input type="email" name="eposta[]" style="width:190px"/></td><td><a href="javascript:void(0);" class="remcf"><span class="btn">-</span></a></td></tr>'); cnt++; }); $("#customfields").on('click','.remcf',function(){ if (confirm("silmek istediğinizden emin misiniz?")) { $(this).parent().parent().remove(); } }); }); jquery(function($){ $("#phone").mask("(999) 999-9999"); });
you have re-append phone mask after appending new row.
Comments
Post a Comment