我如何知道jquery表中的哪些值已更改
我有一个 Html 表,其中包含动态生成的行(从 PHP) 每行都包含带有值的选择框和文本框。 现在我如何知道哪一行已更改(我的意思是选择框和文本框)。 我希望有一个已更改的 (1,3,5,7) 行列表,以便 我可以将它们传递给隐藏并在 php 中检索
("#tb11").change(function(){
//Code
});
I have a Html Table which consists of rows that were generated dynamically (from PHP)
and each row conatins the select box and textbox with the values.
Now how do i know which row has been changed (i mean Select box and textbox).
Iam looking to have a list of (1,3,5,7) rows that have been changed so that
i can pass them to the hidden and retrive in php
("#tb11").change(function(){
//Code
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以监视对象的更改。为输入(我假设它们是输入)提供一个
monitor
类并运行You can monitor object for changes. Give the input's (I'm assuming they are inputs) a class of
monitor
and run这将为您提供已更改的行的索引
That will give you the index of the row, which has been changed
尝试以下代码:
您需要为每一行指定一个唯一的 ID 号,并使用以下代码来处理提交:
try this code:
You will need to give each row a unique id number, and use the following code to handle the submission: