Hi guys i got a problem,
I have a page requesting rows from the other page via ajax
the data that will be return includes a field for date, then use datepicker,
my problem is the return data doest read datepicker from jquery cause it is retrieved via ajax
heres my code:
html file
<table id="job-assign">
<tr>
<!--date picker will work inline html--!>
<td><input type="text" id="sdate1" name="sdate1" class="datepicker"/></td>
</tr>
<tr>
<td>
<input type="button" value="Add Row" onclick="load_row('job-assign','job-assign-len',3)"/>
</td>
</tr>
<table>
js file
#js file
$(function() {
$(".datepicker" ).datepicker();
});
function load_row(cont,len,type){
var suffix = parseInt($('#'+len).val())+1;
var request = $.ajax({
type: "POST",
url: "request_rows.php",
async:false,
data: {row : type, suf : suffix}
});
request.done(function(msg) {
$('#'+cont).append(msg);
});
$('#'+len).val(function(){ return suffix;});
}
request_rows.php
<?php
$type = $_POST['row'];
$suffix = $_POST['suf'];
echo '
<tr>
<!--date picker doest work here --!>
<td><input type="text" id="sdate1" name="sdate1" class="datepicker"/></td>
</tr>'
?>