我在引导模式中有一个表单。我希望输入字段显示用户第一次填写表单时输入的过去值,这些值是我从 cloudant 数据库中检索的。我希望这些输入字段是可编辑的,以便用户可以重新提交表单并进行任何更改。但是,当我尝试在输入字段中显示过去的信息时,我陷入了困境。我找不到输入字段的这些值没有被更改的任何原因。
将我的按钮添加到我的 boostrap 列表组的 javascript:
var loadIotPanel = function(iotsJSON)
{
for(var iot in iotsJSON)
{
var button = $('<button/>').text(iotsJSON[iot].appID).addClass('list-group-item iot').attr({name:iotsJSON[iot].appID, "aria-label": "Quick View IoT", "data-toggle": "modal", "data-target": "#quick-view-iot-modal", type: "button"});
$('#iot-list').append(button);
}
};
Run Code Online (Sandbox Code Playgroud)
我的按钮将放置在我的列表组中的 html:
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-sm-12 dash-col">
<button name="edit-iots" aria-label="Edit IoTs" data-toggle="modal" data-target="#edit-iots-modal" type="button" class="icon"><span class="glyphicon glyphicon-edit gray"></span></button>
<p class="fancy-font dash-item-title">Your IoTs</p>
<button name="add-iot" aria-label="Add IoT" data-toggle="modal" data-target="#connect-iot-modal" type="button" class="icon"><span class="glyphicon glyphicon-plus gray"></span></button>
<div class="list-group iot" id="iot-list"><!-- buttons will be placed here …Run Code Online (Sandbox Code Playgroud)