使用 JQuery 禁用和重新启用动态表单元素
可能是最简单的: http://jsfiddle.net/Ahfm7/4/
查看这个小提琴 下拉列表中的代理和分机值此时已实施。
我遇到了一些错误,希望有人能帮助解决。
第一个是当您添加新的一行下拉列表而不在第一个下拉列表中选择任何内容并继续在第二个下拉列表中选择一个选项时,可以提交表单。
同样,如果您在第一行中选择一个选项,然后添加另一个选项并将其删除,则提交按钮将保持禁用状态。
我只是想知道是否有人知道如何解决这个问题?
It's probably easiest to view this fiddle: http://jsfiddle.net/Ahfm7/4/
Only the agent and extension values in the dropdown have been implemented at this time.
I have encountered a couple of bugs I was hoping someone could help figure out.
The first is when you add a new row of dropdowns without selecting anything in the first and proceed to select an option in the second one, the form can be submitted.
Likewise if you pick an option in the first row, then add another and remove it, the submit button remains disabled.
I was just wondering if anyone knows how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我开始清理代码。我将 700 多行 JS 缩减为更易于管理的内容,但您应该能够理解总体思路。
http://jsfiddle.net/mattball/5ubTe/
一般来说:
enableSubmitButton
函数)var
I started cleaning up the code. I cut the 700+ lines of JS down to something more manageable for SO, but you should be able to understand the general idea.
http://jsfiddle.net/mattball/5ubTe/
In general:
enableSubmitButton
function I added)var
我终于几乎有了一个完整的工作解决方案,但有一个错误:
http://jsfiddle.net/5ubTe/72/< /a>
谢谢你的建议。
I finally almost have a complete working solution but with one bug:
http://jsfiddle.net/5ubTe/72/
Thanks for your advice.