创建动态选择组合框 [英] creating dynamic select combo boxes

查看:84
本文介绍了创建动态选择组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,当你点击一个按钮时,它应该再向现有的表添加5行。此功能有效但我们不得不将其中一个单元从使用文本框更改为使用选择框,然后它不再完全正常工作。我可以看到带有下拉箭头的选择框,但框的宽度与原始选择框的宽度不同。 OnClick和OnChange事件也不适用于新添加的选择框。以下是我们用于创建选择框的代码。我很确定我的其余代码是正确的但是我没有正确输入第3行。


我认为这应该可以做到所以任何帮助来自任何人都会非常感激。

I have a page that when you click on a button it is supposed to add 5 more rows to an existing table. This functionality works but then we had to change one of the cells from using a Text box to using a Select box and then it no longer worked completely. I can see the Select box with the drop down arrow but the width of the box is not the same as the original Select boxes. Also the OnClick and OnChange events do not work for the newly added Select boxes. Below is the code we are using to create the Select boxes. I am pretty sure I have the rest of the code correct but just am not getting line 3 typed in correctly.

I would think that this should be able to be done so any help from any one would be greatly appreciated.

展开 | 选择 | Wrap | 行号

推荐答案

document.createElement方法有使用不正确。


你不能在选择标签中嵌套输入标签。


尝试:
The document.createElement method has been used incorrectly.

You can''t nest an input tag within a select tag.

Try:
展开 | 选择 | Wrap | 行号


我试过你的建议但它根本没有显示选择框。至少使用我在使用Select框之前使用的代码。我注意到你给我的代码示例没有
I tried your suggestion but it did not show the Select box at all. At least with the code I was using before the Select box would show up. I noticed that the code example you gave me did not a have
展开 | 选择 | Wrap | 行号


我可能应该提到此函数位于Javascript部分一个ASP页面。如果缺乏信息导致任何问题,我很抱歉。
I probably should have mentioned that this function is in a Javascript section of an ASP page. I am sorry if this lack of information caused any problems.


这篇关于创建动态选择组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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