1、<a href="JavaScript:void(0);" class="bs-tooltip remark-item" rel="{$bill.id},{$bill.username},{$bill.remark}"><i class="icon-pencil"></i>备注</a>
2、<!-- 模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button><h4 class="modal-title" id="myModalLabel"> 备注 </h4></div>
<form class="form-horizontal row-border" method="post" role="form" id="remark">
<input type="hidden" name="id" id="bill_id" value=""/>
<div class="modal-body">
<div class="form-group">
<label class="col-md-2 control-label">客户名称:</label>
<div class="col-md-10">
<input type="text" id="user_username" value="" class="form-control input-width-medium" disabled />
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">备注:</label>
<div class="col-md-10">
<input type="text" name="remark" id="bill_remark" value="" class="form-control input-width-xlarge" placeholder="备注" />
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭 </button>
<button type="submit" class="btn btn-primary"> 确定 </button>
</div>
</form>
</div>
</div>
</div>
3、js调用
$("a.remark-item").click(function (b) {
var data=$(this).attr('rel');
var result = data.split(",");
$("#bill_id").val(result['0']);
$("#user_username").val(result['1']);
$("#bill_remark").val(result[2]);
$("#myModal").modal();
});