【发布时间】:2013-04-19 22:03:43
【问题描述】:
我想知道如何基于 type='number' 框创建多个文本框...所以一旦有人将 1 添加到数字框,另一个文本框字段将附加到主干.js查看...然后一旦有人在这些文本框中输入值,将每个值添加到主干模型数组中的一个位置。以下是部分代码:
<label for='choices'># Choices for Students</label>
<input type='number' name='choices' step=1 />
initialize: function(opts) {
this.model = new QuestionCreateModel({
mode: null,
choices: ['A', 'B', 'C'],
Question: "Question goes here",
MaxChoices: 0,
MinChoices: 0,
WordLimit: 0,
CharLimit: 0,
}),
如您所见,我想要输入 type='number',然后加载文本框,这样我就可以将值分配给 Backbone 模型中的选择数组。
感谢您的帮助!
-斯图
【问题讨论】:
标签: javascript arrays dynamic backbone.js input