使用JQuery禁用并重新启用动态表单元素 [英] Disabling and Re-Enabling Dynamic Form Elements with JQuery

查看:133
本文介绍了使用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.

我遇到过几个bug我希望有人可以帮到弄清楚。

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?

推荐答案

我终于有一个完整的工作解决方案,但有一个错误:

I finally almost have a complete working solution but with one bug:

http://jsfiddle.net/5ubTe/72/

感谢您的意见。

这篇关于使用JQuery禁用并重新启用动态表单元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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