如何阻止删除动态表单元素的最后一个实例?
如果您可以查看正在运行的代码,可能会更容易:
基本上,我想做的就是阻止最后一组下拉菜单被删除,作为奖励 - 弄清楚如何淡出删除以及 - 由于某种原因我无法让它工作。
感谢您的帮助,非常感谢。
问候,
马丁
its probably easier if you can have a look at the code in action:
Bascially, all I want to do is stop the last set of dropdowns from being able to be deleted and as a bonus - figure out how to fade out the deletes aswell - I couldn't get that to work for some reason.
Thanks for any help, it's much appreciated.
Regards,
Martin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我添加了代码来淡出已删除的下拉列表。
http://jsfiddle.net/6xPye/1/
另外,以下代码:
确保如果用户删除顶行后,仍然有一个 .dropdown 供
addNew()
函数克隆。I added code to fade out the deleted drop downs.
http://jsfiddle.net/6xPye/1/
Also, the following code:
Assures that if the user deletes the top row there is still a .dropdown for the
addNew()
function to clone.我修改了它:
http://jsfiddle.net/scheffield/esEmh/
本质上我添加了一个函数 < code>remove
它并不完全完美,但它可以工作......
i modified it:
http://jsfiddle.net/scheffield/esEmh/
Essentially I added a function
remove
It's not exactly perfect but it works...