jQuery datepicker onSelect 设置多行值
在日期选择器的选择事件中,我需要在多行中添加和设置值。换句话说,我有这样的内容...
Days Value
Row 1 7
Row 2 2
Row 3 3
我将“天”和“值”列作为文本框。当我从日期选择器中选择日期时,我需要将每行的“天”值添加到所选日期。该值就是“值”列中的内容。例如,我选择 4/20/2010。每个相应行中的值将为 4/28/2010、4/22/2010、4/23/2010。
希望这是有道理的,并提前感谢您的帮助。
编辑 -------
路易斯,我尝试用我所拥有的代码来实现你的代码,但有一个问题。我从日期选择器中选择了 2010 年 4 月 21 日。因此,在上面的示例中,第一行应该是 4/28/2010。但我不明白。它将于 2010 年 11 月 3 日回归。您或有人可以帮助我理解原因吗?谢谢。
感谢您的更新。这很有帮助。
On the select event of the datepicker I need to add and set values in multiple rows. In other words, I have something like this...
Days Value
Row 1 7
Row 2 2
Row 3 3
I have the "Days" and "Value" columns as textboxes. When I select a date from the datepicker I need to add the "Days" value for each row to the date selected. That value is what goes into the "Value" column. Example, I select 4/20/2010. The value in each respective row would then be 4/28/2010, 4/22/2010, 4/23/2010.
Hopefully this makes sense and thank you for the help in advance.
EDIT -------
Luis, I've tried implementing your code with what I had and have a question. I selected from my datepicker 4/21/2010. So the first row, in my example above, should be 4/28/2010. I'm not getting that though. It's returning 11/3/2010. Can you or someone help me please with understanding why. Thanks.
Thank you for the update. It was helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您有一个 id 为 datePicker 的输入字段,并且该表的 id 为 myTable:
say you have an input filed with an id of datePicker adn the table has an id of myTable: