I have a button and upon clicking that button I am showing a form in bootstrap model.
(我有一个按钮,单击该按钮后,我会在Bootstrap模型中显示一个表单。)
What I want to achieve is to show confirmation box on form submit.(我要实现的是在表单提交上显示确认框。)
Everything is fine but confirmation is appear at the background of bootstrap model.(一切都很好,但是确认出现在引导模型的背景下。)
HTML
(的HTML)
<div class="text-right">
<button type="button" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-target=".bs-example-modal-lg">Notify Customer</button>
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class ="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0" id="myLargeModalLabel">Notification Message</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<form class="form-horizontal submit-notify" method="POST" action="{{route('backend.customers.notify', $customer->id)}}">
{{csrf_field()}}
<div class="form-group">
<label for="title" class="col-form-label">Title</label>
<div>
<input type="text" name="title" class="form-control" required placeholder="Enter Notification Title" value="@if(old('title')){{old('title')}}@endif" />
</div>
</div>
<div class="form-group">
<label for="message" class="col-form-label">Message</label>
<div>
<textarea type="text" name="message" class="form-control" rows="5" placeholder="Enter Notification Message">@if(old('message')){{old('message')}}@endif</textarea>
</div>
</div>
<div class="form-group">
<label>Options</label>
<div>
<label class="custom-control custom-checkbox" style="display: inline-block !important;">
<input type="checkbox" class="checkbox m-r-10" name="options[]" value="mail" data-parsley-required="true" data-parsley-multiple="groups"
data-parsley-mincheck="1">
<span class="custom-control-indicator"></span>
<span class="custom-control-indicator">Mail</span>
</label>
<label class="custom-control custom-checkbox" style="display: inline-block !important;">
<input type="checkbox" class="checkbox m-r-10" name="options[]" value="push" data-parsley-multiple="groups"
data-parsley-mincheck="1">
<span class="custom-control-indicator"></span>
<span class="custom-control-indicator">Push</span>
</label>
<span id="error-box"></span>
</div>
</div>
<div class="form-group">
<div>
<button type="submit" class="btn btn-pink waves-effect waves-light confirm-submit">
Send
</button>
</div>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Here is the javascript for alertyfy.
(这是用于alertyfy的JavaScript。)
Javascript
(Java脚本)
<script type="text/javascript">
$(document).ready(function () {
$(".confirm-submit").on('click',function(event){
event.preventDefault();
var form = $(this).closest('form');
var confirm = alertify.confirm("Are you sure you want to submit details ?",function (e) {
if(e){
form.submit();
}
else{
return false;
}
});
});
});
</script>
I have tried following two as recommended in stack overflow and medium.
(我已经尝试按照堆栈溢出和介质中的建议进行以下两个操作。)
First
(第一)
By removing tabindex="-1"
from model.
(通过从模型中删除tabindex="-1"
。)
Recommended here: alertify upon a bootstrap modal not working
(在这里推荐: 在引导模态不起作用时发出警报)
Second
(第二)
By placing following css:
(通过放置以下CSS:)
.alertify-logs{
z-index:999999 !important;
}
None of these work in my case.
(在我看来,这些都不起作用。)
What would be the problem.(怎么了)
I am using laravel framework.(我正在使用laravel框架。)
ask by Sagar Gautam translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…