关闭popover的脚本:
$(document).on("click",".close", function(){
$("#add-users-from-emails-btn").popover('hide');
});
酥料饼:
$("#add-users-from-emails-btn").popover({
placement: "bottom",
title: '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> {{'user.index.enter_users_emails_each_rows'|trans|raw}}',
html: true,
content: $("#add-users-from-emails-popover")
}).on('show.bs.popover', function(){
$("#add-users-from-emails-popover").removeClass("hidden");
}).on('shown.bs.popover', function(){
$("#add-users-from-emails-popover textarea").focus();
});
形式:
<form id="add-users-from-emails-popover" class="hidden clearfix" style="width: 300px;" method="post" action="{{path('adm_user_addusersfromemails')}}">
<select name="business" class="form-control">
<option class="empty" value>{{'empty_value'|trans({},'app')}}</option>
{% for b in business %}
<option value="{{b.id}}">{{b.businessName}}</option>
{% endfor %}
</select>
<textarea name="emails" style="margin-top: 10px" rows="5" class="form-control" style="max-width: 300px;"></textarea>
<button type="submit" style="margin-top: 10px" class="btn btn-default btn-xs pull-right" id="save-users-from-emails-btn">{{ 'user.index.add_users'|trans }}</button>
</form>
我做错了什么? ; - )
问题已解决 关闭popover的正确脚本:
$(document).on("click",".close", function(){
$("#add-users-from-emails-btn").click();
});