彩色盒覆盖中的克隆表单
我正在使用 colorbox 覆盖插件......
在页面底部我有一个 div,其表单包含文本/复选框和提交按钮(还有客户端验证来检查复选框是否为勾选为必填)。我正在将 DIV 克隆到颜色框叠加层中...它工作得很好,因为我使用 jquery 克隆方法来显示叠加层中的内容。
我的问题是 bcoz 内容被克隆,如果我选择主页上的复选框,覆盖层会勾选该复选框,但如果我勾选/取消勾选覆盖层中的复选框,主页上的内容将保留未更改,因此不会从叠加层提交表单。
有什么方法可以让我执行以下操作... 即使在主页上勾选了复选框...覆盖层中的内容不应继承该勾选,即使它是克隆的...因此它的行为彼此独立。
I am using colorbox overlay plugin........
At the bottom of the page I have a div with form containing text/check-box and submit button (there is also client side validation to check if the check-box is ticked as its mandatory). I am cloning the DIV into a color-box overlay...which works fine as I am using jquery clone method to display the contents in the overlay.
I issue is bcoz the content is cloned, if I select the check-box on the main page the overlay has the check-box ticked but if I tick/un-tick the check-box in the overlay the content on the main page remains unchanged, due to which the form is not getting submitted from the overlay.
Is there a way I can do the following...
Even if the check-box is ticked on the main page...the content in the overlay should not inherit the tick even though its cloned...so it behaves independent of each other.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恕我直言,这是一个 JQuery 问题,而不是 ColorBox 问题。
确保克隆时布尔值 withDataAndEvents 设置为 False。 (请注意,Jquery 1.5.0 中的默认值为 True,后来修改为 False。)
或者我遗漏了什么?
IMHO, this is a JQuery question more than a ColorBox question.
Ensure the boolean withDataAndEvents is set to False when cloning. (Note that the default was True in Jquery 1.5.0 and was later revised to be False.)
Or am I missing something?