Hello,
I would like to create notification on press Purchase through a pop up. Such as "Thank you. We will process your request. Please check your email." How to create the javascript to create pop up?
<form action="{{ action('SettingController@getBackgroundTheme') }}" method="get" id="notification">
<span class="setting-name">THEME</span>
<!-- <form method="POST" action="/posts"> -->
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<!-- {{ csrf_field() }} -->
<span class="setting-value center">
<select name="menu">
<option value="">All</option>
<option value="Handicraft">Handicraft</option>
<option value="Farming">Farming</option>
<option value="Services">Services</option>
<option value="Tour & Travel">Tour & Travel</option>
<option value="Trading">Trading</option>
<option value="Fishery">Fishery</option>
<option value="Lifestyle">Lifestyle</option>
<option value="Music">Music</option>
<option value="Property">Property</option>
<option value="Hobby">Hobby</option>
<option value="Politic">Politic</option>
</select>
<input type="submit" value="Submit">
<br><br>
</span>
</form>
<form
action="{{ action('SettingController@SendPicture') }}"
method="post"
>
{{ csrf_field() }}
<table>
@foreach ($themes->chunk(3) as $chunk)
<tr>
@foreach ($chunk as $theme)
<td>
<a href="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg" data-lightbox="image-gallery" data-title="{{$theme->pic_name}}" >
<img width="100px"
height="100px"
src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/></a>
<input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>
</td>
@endforeach
</tr>
@endforeach
</table>
@if ( $themes->lastPage() == 0) <br><br><br><br> @endif
@if ( $themes->currentPage() != 1)
<a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif
{!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}
@if ( $themes->currentPage() != $themes->lastPage())
<a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif
<br><br><input style="width: 15px; margin-bottom: -10px; position: relative;" type="checkbox" required name="chkbox_agreement" value="Terms & Agreement"/>
<a href="#myModal" data-backdrop="false" data-toggle="modal">Terms & Agreement</a>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5>Terms & Agreement</h5>
</div>
<div class="modal-body">
By clicking Purchase you agree to the Term and Conditions.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Agree</button>
</div>
</div>
</div>
</div><br><br><br>
<input type="submit" value="Purchase">
</form>
I try to add this on bottom I wonder why it does not work:
<script>
$(".notification").click(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: '{{action("SettingController@SendPicture")}}',
data : {
},
success: function (response) {
if (response=='"success"') {
pesanOk("Thank you. We will process your request. Please check your email.");
}else{
pesanErr("failed");
};
}
});
</script>