jquery datepicker 部分不工作
你好,我有一个可以完美单独工作的日期选择器,代码如下:
<link rel="stylesheet" href="uidatepicker/themes/blitzer/jquery.ui.all.css">
<script src="uidatepicker/jquery-1.5.1.js"></script>
<script src="uidatepicker/jquery.ui.core.js"></script>
<script src="uidatepicker/jquery.ui.widget.js"></script>
<script src="uidatepicker/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="uidatepicker/demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
showOn: "both",
buttonImage: "uidatepicker/calendar.gif",
buttonImageOnly: true
});
});
</script>
<form method="post" action="saveEvent.php">
<p>Titulo del evento:</p>
<input type="text" name="title" value="" class="text-input medium-input datepicker"/>
<p>Descripcion:</p>
<textarea name="message"></textarea>
<p>Fecha:</p>
<input type="text" name="date" value="" id="datepicker"/>
<p>Locacion:</p>
<select name="locationId" class="small-input">
<option value="">--- Selecciona ---</option>
<option value="3">La charanguita</option>
<option value="7">H20</option>
<option value="8">Bleu</option>
</select>
<p>Url del icono: (150x135px)</p>
<input type="text" name="smallIconUrl" value="" class="text-input medium-input"/>
<p><input type="submit" value="Nuevo Evento" class="button" /></p>
</form>
我从另一个文件加载它,如下所示:
$('#EventsContent').load('partials/newEvent.php');
问题是,无论我尝试什么,日期选择器都不会出现,这对我来说已经钉了三天了。
阻碍 jquery ui datepicker 正确操作的确切问题是什么??+
提前感谢您的帮助。
hello i have a datepicker that is working perfectly alone, code is like:
<link rel="stylesheet" href="uidatepicker/themes/blitzer/jquery.ui.all.css">
<script src="uidatepicker/jquery-1.5.1.js"></script>
<script src="uidatepicker/jquery.ui.core.js"></script>
<script src="uidatepicker/jquery.ui.widget.js"></script>
<script src="uidatepicker/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="uidatepicker/demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
showOn: "both",
buttonImage: "uidatepicker/calendar.gif",
buttonImageOnly: true
});
});
</script>
<form method="post" action="saveEvent.php">
<p>Titulo del evento:</p>
<input type="text" name="title" value="" class="text-input medium-input datepicker"/>
<p>Descripcion:</p>
<textarea name="message"></textarea>
<p>Fecha:</p>
<input type="text" name="date" value="" id="datepicker"/>
<p>Locacion:</p>
<select name="locationId" class="small-input">
<option value="">--- Selecciona ---</option>
<option value="3">La charanguita</option>
<option value="7">H20</option>
<option value="8">Bleu</option>
</select>
<p>Url del icono: (150x135px)</p>
<input type="text" name="smallIconUrl" value="" class="text-input medium-input"/>
<p><input type="submit" value="Nuevo Evento" class="button" /></p>
</form>
and i am loading it from another file as in:
$('#EventsContent').load('partials/newEvent.php');
Problem is datepicker never appears no matter what i tried, this has been nailing for me for like 3 days now.
What is the exact problem impeding the correct operation of jquery ui datepicker??+
Thanks in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用哪种输入文本日期选择器?我看到你有一个 id="datepicker " 和 class="datepicker "?
我将 ' 替换为 " ,我在浏览器“IE,FireFox,GoogleChrome”中测试代码,它可以工作。
我使用 JQuery 1.5.2 和jquery-ui-1.8.10,不过我觉得版本问题不大。
4.我有另一个理想,你可以在加载完整时重新绑定datepicker事件,如下所示:
当你加载partial后使用datatpicker时,你必须重新绑定,但是JQuery live()函数可以帮助我们执行此操作,请参阅 http://api.jquery.com/live/
而不是:
which input text you use datepicker? I saw you have an id="datepicker " and class="datepicker "?
I replace the ' to " , I test the code in browser "IE,FireFox,GoogleChrome", it's work.
I use JQuery 1.5.2 & jquery-ui-1.8.10, but I think version is not a big problem.
4. I have the other ideal, you can re-Bind the datepicker event when you load complete like this:
When you use the datatpicker after you load the partial , you must re-bind, but JQuery live() function can help us to do that things, see http://api.jquery.com/live/
instead of :