<div class="comment-box">
<form id="contactform" method="POST" >
{{ csrf_field() }}
<input type="hidden" name="user_id" value="{{Auth::user()->id}}">
<input type="hidden" name="order_id" value="{{$order->id}}">
<textarea class="comment-box-input" name="description" placeholder="Напишите комментарий…" dir="auto" style="overflow: hidden; overflow-wrap: break-word;"></textarea>
<div class="comment-box-act">
<button class="comment_buttom" type="submit">Отправить</button>
</div>
</form>
</div>
<div id="weather-temp"></div>
<script>
$(document).ready(function(){
$('.comment-box').on('submit','#contactform', function(e){
e.preventDefault();
$.ajax({
type: 'POST',
url: '/admin/order/modal/addcomment',
data: $('#contactform').serialize(),
success:function(data){
$( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" );
}
});
$('input[type="text"], textarea').val('');
});
});
</script>
success:function(data){
$( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" );
}
$(document).ready(function(){
$('#contactform').on('submit', function(e){
e.preventDefault();
$.post('/admin/order/modal/addcomment', $('#contactform').serialize(),function(data){
$( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" );
});
$('input[type="text"], textarea').val('');
});
});