When swal is used on click of button, it works fine on desktop browsers. But when same page is accessed from the mobile browser and submit the form, it just gave a blank white page.
<form name="test" action="test.php" id="reviewForm">
<div class="row">
<div class="form-group">
<div class="col-md-5 col-sm-12 col-xs-12">
<input type="button" class="btn btn-success" id='reviewSubmit' value="Submit Your Review"/>
</div>
</div>
</div>
</form>
$(document).ready(function () {
$("#reviewSubmit").on ('click',function (e) {
var esc_review=escapeHtml($("#review").val());
var input = $("<input>")
.attr("type", "hidden")
.attr("name", "review1").val(esc_review);
$('#reviewForm').append($(input));
swal({
title: 'Are you sure you want to submit this review?',
text: "This review will be submitted "
+ "and once approved will be displayed in the website ",
type: 'warning',
showCancelButton: true,
confirmButtonText: 'Submit',
cancelButtonText: 'Cancel',
confirmButtonClass: 'btn btn-success',
cancelButtonClass: 'btn btn-danger',
showLoaderOnConfirm: true,
preConfirm: function () {
return new Promise(function (resolve) {
$('#reviewForm').submit();
});
},
allowOutsideClick: false
});
});