Submit Form using AJAX in Laravel 4

How to make the page not refresh after I submit with the help of using AJAX in LARAVEL 4?


{{ Form::open(['url' => '/booking/unit', 'method' => 'POST', 'id' => 'readForm']) }}
{{ Form::hidden('bookingid', $booking->id) }} 
{{ Form::hidden('unitid', $booking->unit) }} 
<button class="btn btn-warning" data-toggle="collapse" data-target="#{{$booking->id}}" type="submit">{{ $booking->status }}</button>
{{ Form::close() }}


    data = $(this).serialize();
        type: "POST",
        dataType: "json",
        url: "../booking/unit", 
        data: data,
        success: function(data) {
            alert("Form submitted successfully.nReturned json: " + data["json"]);
    return false;


my page is still refreshing. why?

Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.