javascript - TimeEntry Js function not working for Dynamically added textboxes -
<td style='vertical-align: middle;'><input name='drivetimedayslots[" + index + "].starttime' class='smalltxtentry0 drivetimedayslot hastimeentry' id='drivetimedayslots_" + index + "_starttime' type='text' value='' onchange='drivetimedayslotvalueonchnge(this)' data-timeentry='show24hours: true, showseconds: true, defaulttime: 00:00:00'/></td>" + "<td style='vertical-align: middle;'><input name='drivetimedayslots[" + index + "].endtime' class='smalltxtentry0 drivetimedayslot hastimeentry' id='drivetimedayslots_" + index + "_endtime' type='text' value='' onchange='drivetimedayslotvalueonchnge(this)' data-timeentry='show24hours: true, showseconds: true, defaulttime:00:00:00'/></td>" + "<td style='vertical-align: middle;'><input name='drivetimedayslots[" + index + "].defaulttimetaken' class='smalltxtentry0 drivetimedayslot hastimeentry' id='drivetimedayslots_" + index + "_defaulttimetaken' type='text' value='' onchange='drivetimedayslotvalueonchnge(this)' data-timeentry='show24hours: true, showseconds: true, defaulttime:00:00:00'/></td>" +
i adding textboxes on button click. on document.ready have written:
$(document).ready(function () { $('.drivetimedayslot').timeentry({ show24hours: true, showseconds: true, defaulttime: "00:00:00" }); });
but not firing dynamically added textboxes
new element created dynamically had not been picked timeentry function because created after call function. need calling timeentry function each time after add row(at end of function ).
function urfunction() { //your codes $('.drivetimedayslot').timeentry({ show24hours: true, showseconds: true, defaulttime: "00:00:00" }); }
Comments
Post a Comment