Clone a div that contains “customized” jQueryUI datePicker

邮差的信 提交于 2021-01-27 10:47:55

问题


I have a div that contains 3 fields

You can see the image here
http://imgur.com/A3tbd.jpg

I'm cloning this div with this plugin
http://sroucheray.org/blog/demos/jquery-dynamic-form/

My problems are:

  • It doesn't clone correctly datePicker.
  • I'm using validate form plugin, but I guess this plugin is not prepared to validate cloned elements

Is there any easy code, other plugin or some functions I should use for doing this sequence?

  • Verify user has filled the 3 fields of the actual div
  • If so, clone the div and create a new set of 3 fields. Also, clone datePicker correctly
  • If user clicks the delete button, erase last div (last 3 fields)
  • When form submitted, post all fields correctly

Thanks,


回答1:


I ran in to a problem just like that with the date picker and cloning it. My solution was to remove the date picker prior to the cloning the elements. Then after cloning the elements, initialize the datepicker on the clone.



来源:https://stackoverflow.com/questions/2633798/clone-a-div-that-contains-customized-jqueryui-datepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!