本文介绍了在使用ajax加载url提交表单后,jquery datepicker无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在这里有一些问题..当在页面中(addisy.php有jquery datepicker并且它工作得很好。)我使用ajaxForm提交我的表单。提交后,页面已加载主页面,名称为isylist.php。然后,如果我再次点击addisy.php,jquery datepicker不再工作..can codeproject成员帮助我在代码中出错或冲突?
我的代码在这里:addisy.php
i have some problem here..when in page (addisy.php which is have jquery datepicker and its work well.) i submit my form using ajaxForm. after submitting,the page has loaded the main page which is name as isylist.php. then, if i click again the addisy.php, the jquery datepicker not working anymore..can codeproject member help me where in the code was error or conflict??
my code is here : addisy.php
<script src="js/jquery.js"></script>
<script src="json/jquery.form.js"></script>
<script>
var j = $.noConflict();
(function() {
j('#isyform').ajaxForm({
success: function(xhr) {
},
complete: function(xhr) {
alert(xhr.responseText);
$('#frame').load('isylist.php');
}
});
})();
</script>
<div id="frame">
<form action="saveisy.php" method="post" id="isyform">
<input type="text" id="datecollected" name="datecollected" class="datepicker" />
<script>
$(document).ready(function () {
$("#datecollected").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "d-m-yy"
});
});
</script>
<input type="submit" id="save" name="save" value="Save" />
</form>
</div>
推荐答案
<div id="frame">
<form action="saveisy.php" method="post" id="isyform">
<input type="text" id="datecollected" name="datecollected" class="datepicker" />
<script>
这篇关于在使用ajax加载url提交表单后,jquery datepicker无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!