用户追加行后,不会显示文本输入(text input does not appear once user appends a row)

编程入门 行业动态 更新时间:2024-10-18 05:58:06
用户追加行后,不会显示文本输入(text input does not appear once user appends a row)

我这里有一个小提琴: http : //jsfiddle.net/ybZvv/11/

我遇到的问题是,当你打开小提琴时,如果你点击“AH”按钮上的几个按钮,然后点击“添加问题”按钮将按钮附加到一个新的表格行,下面没有文字输入。表。

但是如果你打开一个不同的按钮,在表格行中,它会显示该按钮的文本输入。

我的问题是,一旦用户点击“添加问题”按钮,如何从顶部控件中的打开按钮显示文本输入?

以下是应该发生的事情:

在顶部控件处,打开按钮A和D. 单击“添加问题”按钮,这应该附加一行,但它也应显示按钮“A”和“D”的文本输入。

I have a fiddle here: http://jsfiddle.net/ybZvv/11/

The problem I have is that when you open the fiddle, if you click on a couple of buttons from buttons "A-H" and then click on "Add Question" button to append the buttons into a new table row, no text inputs appear underneath the table.

But within the table row if you turn on a different button, then it displays the text input for that button.

What my question is that how can I have the text inputs to appear from the turned on buttons in the top control once the user clicks on the "Add Question" button?

Below is what should happen:

Right at the top control, turn on buttons A and D. Click on the "Add Question" button and this should append a row, but it should also display the text inputs for buttons "A" and "D".

最满意答案

我将btnclick中的一些代码重构为一个新方法updateAnswer ,它收集所有打开的按钮并将一个输入添加到答案容器中。 然后从btnclick和insertQuestion调用该方法。

我更新了jsFiddle示例 。

I refactored some of the code from btnclick to a new method updateAnswer which collects all the buttons that are turned on and adds an input to the answer container. The method is then called from btnclick and insertQuestion.

I updated the jsFiddle example.

更多推荐

本文发布于:2023-07-06 07:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1047391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   用户   text   input   appends

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!