this is my more of my page body code, a table and a form tag,table use bootgrid plugin, although I have used modal-body class to select input tag,It didn't work.
<div id="listdata" style="overflow-y:scroll;">
<table id="grid" class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th data-column-id="SN" data-type="numeric" data-order="asc" data-identifier="true">序号</th>
<th data-column-id="UserName" data-order="asc">姓名</th>
<th data-column-id="UserAccount">账号</th>
</tr>
</thead>
</table>
</div>
<form>
<div id="editmodal" class="modal hide">
<div class="modal-body">
<div class="form-horizontal form-container">
<div class="form-group">
<label for="UserName" class="col-sm-2 control-label">姓名:</label>
<div class="col-sm-10">
<input type="text" id="UserName" name="UserName" class="form-control" placeholder="姓名" value="" />
</div>
</div>
</div>
</div>
</div>
</form>
function saveData() { //if (!validate()) return;
var items = $("form:first .modal-body input");
var json = [];
$(items).each(function (index, item) {
if (item.type == "text") {
json.push({ "name": item.id, "value": item.value });
} else if (item.type == "checkbox" || item.type == "radio") {
json.push({ "name": item.id, "value": item.checked ? "true" : "false" });
}
});
}