当您单击提交到面板时,我想更改模态输入的值。因此,如果用户写入输入,则他编写的值将替换下面面板的内容。 JSFiddle:
模态的主要结构:
<div id="dialog" title="Task detail">
<div class="modal-body">
<div class="row-fluid" style="padding-bottom: 0px;">
<form id="taskForm" class="form-horizontal" role="form">
<input type="hidden" name="id" value="2">
<div class="form-group">
<label for="inputName" class="col-xs-3 col-sm-3 col-md-1 control-label">Name</label>
<div class="col-xs-5 col-sm-5 col-md-10">
<input id="inputName" name="name" type="text" class="form-control" placeholder="Name" value="">
</div>
</div>
<div class="form-group">
<label for="inputURI" class="col-xs-3 col-sm-3 col-md-1 control-label">URI</label>
<div class="col-xs-2 col-sm-8 col-md-10">
<input id="inputURI" name="uri" type="text" class="form-control" placeholder="URI" value="">
</div>
</div>
<div class="form-group">
<label for="inputPlanning" class="col-xs-3 col-sm-3 col-md-1 control-label">Planning</label>
<div class="col-xs-5 col-sm-5 col-md-10">
<input id="inputPlanning" name="planning" type="text" class="form-control" placeholder="Planning" value="">
</div>
</div>
<div class="form-group">
<label for="inputOrder" class="col-xs-3 col-sm-3 col-md-1 control-label">Order</label>
<div class="col-xs-2 col-sm-2 col-md-10">
<input id="inputOrder" name="numOrder" type="text" class="form-control" placeholder="Order">
</div>
</div>
<div class="form-group">
<label id="chkActive" for="chkActive" class="col-xs-3 col-sm-3 col-md-1 control-label">Active</label>
<div class="col-xs-5 col-sm-5 col-md-10">
<div class="miniswitchmodal" style="float: left;">
<input type="checkbox">
<label><i class="glyphicon glyphicon-off"></i></label>
</div>
</div>
</div>
<div class="modal-footer">
<button id="btnSave" type="button" class="btn btn-success modalbtn">Save changes</button>
<button id="btnClose" type="button" class="btn btn-default modalbtn" data-dismiss="modal">Close</button>
</div> </form></div></div></div>
小组的主要结构:
<div class="col-xs-6 col-sm-4 col-md-3">
<div id="7" class="panel panel-off2">
<div class="panel-heading">
<div class="row">
<div class="ptitle">Task 7</div>
<div class="optiongroup"> <span class="glyphicon glyphicon-edit yellow"></span>
<div class="miniswitch">
<input type="checkbox" data-id="7">
<label><i class="glyphicon glyphicon-off"></i></label>
</div>
</div></div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-12"><strong>Planning:</strong><span> 0/10 * * * * ?</span></div>
</div>
<div class="row">
<div class="col-xs-12">
<strong>URI:</strong><span> /cron/test</span>
</div>
</div>
</div>
</div>
</div>