i am using jquery datepicker on jsp page and when i call ajax to load some data from server and on success of ajax data loads to div tag after that i cant see the datepicker.
when i click on textfield i shows date picker but on click of button i m loading data through ajax and after that date picker is not working
<html>
<head>
<script>
$(document).ready(function()
{
$('#end_dtnw').datepicker({ dateFormat: 'dd-M-yy' });
$("#reportList").click(function(){
$.ajax({
type : 'Post',
url : 'www.google.com',
data: "prjid="+prjid,
beforeSend : function(){
},
success : function(data){
$('#newreportdata').html(data);
},
error : function(jqXHR, textStatus, errorThrown){
}
});
});
}
</script>
</head>
<body>
<input type="text" name="end_dtnw" id="end_dtnw" />
<input type="button" name="reportList" id="reportList" />
<div id="newreportdata"></div>
</body>
</html>
//consider that my coding is correct.....
THANKS in advanced....开发者_运维百科..
Sounds like the HTML you are loading has a problem. Care to show us that? Then we could see the problem. Also, show us the HTML for #end_dtnw
and #newreportdata
.
Thanks for the edit -- your HTML does not match the screen shot-- I don't see the from and to text etc. Please show the code that has the problem or reproduce in a reduced state.
You can also make a test case on jsfiddle.com and show me that -- then we can all see the error happening.
Here is an article about the datepicker using the live() function in jQuery(AJAX):
http://www.vancelucas.com/blog/jquery-ui-datepicker-with-ajax-and-livequery/
This can help you.
精彩评论