php jquery datepicker在forloop里面没有工作 [英] php jquery datepicker not working inside forloop

查看:62
本文介绍了php jquery datepicker在forloop里面没有工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述









我有一个for循环写出一个记录列表到一个网页,现在我想要的是显示一个显示日期的链接,当点击链接时会显示一个对话框供用户编辑日期,我得到了那个但是有些如何添加第二条记录时它不会似乎工作,



谢谢

解决方案

您写道,您正在使用循环,但您申请基于ID的功能(''#timeOff2'')。但是页面上只能有一个带有此ID的元素。我不是想知道它不起作用,你错误地处理了html标准。不要在页面内重复使用ID。在这种情况下,你应该使用类。你也不需要每个

 


' .DatePicker-needed ')。datepicker({dateFormat: dd / mm / yy,yearRange:' c:c + 10',changeMonth: true ,changeYear: true });


Hi,



I have a for loop writing out a list of records to a web page, now what I want is to display a link that displays a date, when clicking the link it brings up a dialog box for the user to edit the date, I got that rite but some how when a second record is added it doesnt seem to work,

Thanks

解决方案

You wrote, your are using a loop, but you apply the feature based on ID (''#timeOff2''). But there can be only one element on the page with such ID. I am not wondering that it does not work, you mishandle the html standard. Don''t reuse ID within page. In this case you should use class. And you don''t need each either.


('.DatePicker-needed').datepicker({ dateFormat: "dd/mm/yy", yearRange: 'c:c+10', changeMonth: true, changeYear: true});


这篇关于php jquery datepicker在forloop里面没有工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆