如何使用上次插入的数据更新下拉框 [英] How to update drop down box using data from last insert

查看:83
本文介绍了如何使用上次插入的数据更新下拉框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Javascript中有表,它有addrow,deleterow,submit和functions。

当我点击它时自动添加新行,它有选择选项中的一些选项

for ex。添加两行其中一行是主板华硕,另一行是主板技嘉。


我想有一个下拉组合框。当我从下拉菜单中选择一项时,在下一行输入中,该选项在下拉菜单中不存在。


这是我的代码。

谢谢beforehands

I have table in Javascript and it has addrow, deleterow, submit, and functions.
when i click it automatically adds new row and it has select option to choose some of them
for ex. in added two rows one of them is Motherboard Asus and other is Motherboard Gigabyte.

I would like to have a drop down combo box. When i chose one item from drop down menu and in the next row of input that option let not exist in drop down menu.

Here is my code.
Thanks beforehands

展开 | 选择 | Wrap | 行号

推荐答案

我不确定我是否完全理解了什么你要。如果选择某个选项,您希望在下一行中该选项是否出现在选择框中?如果是这样,请检查每行的值以确定哪些不应出现。使用数组来存储这些值可能会有所帮助。
I''m not sure if I''ve quite understood what you want. Do you want that when a certain option is selected, in the next row, that option doesn''t appear in the select box? If so, check the values of each row to decide which ones shouldn''t appear. It may help to use an array to store these values.


这证实了我的理解。


使用每个选择框的''值行以查看已在插入函数中选择了哪些,例如
That confirms what I understood.

Use the select boxes'' value of each row to see which ones have already been selected in your insert function, e.g.
展开 | 选择 | Wrap | 行号


你可以按照你说的那样做你想要的方法

谢谢你
you can do as you said or another method you want
thank you


这篇关于如何使用上次插入的数据更新下拉框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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