nitiphone2021 Posted February 3, 2021 Share Posted February 3, 2021 I have a problem about the javascript datepicker. in index.html it has startdate and enddate it's work but when i click a button, it will open new modal up and the new modal has a date picker(I create it again as below command ) but it's not work, this datepicker name SamplingDate is not create from beginning and startdate & enddate create from begining var col4 = "<div class='row p-2'><div class='col'><label>Send Sampling Date:</label><div div class='input-group date'><div class='input-group-prepend'><span class='input-group-text'><i class='far fa-calendar-alt'></i></span></div><input type='text' class='form-control' data-inputmask-alias='datetime' data-inputmask-inputformat='dd/mm/yyyy' data-mask='' inputmode='numeric' id='SamplingDate'></div></div></div></div>"; var formupdate1 = col1.concat(col2,col3,col4,col5,submit); document.getElementById('Updateform').innerHTML = formupdate1; Work, startdate and enddate after load page $('#startdate').datepicker({ autoclose: true }) $('#enddate').datepicker({ autoclose: true }) // not work $('#SamplingDate').datepicker({ autoclose: true }) Quote Link to comment https://forums.phpfreaks.com/topic/312091-datepicker-not-work-when-i-create-it-by-innerhtml/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.