'Prevent form from reload in laravel modal

I am working on modal submit form , the problem that when I click on submit in the modal, the whole page is reloaded and all the other data is cleared.

I have tried a lot of solutions but none has worked. For example adding return false

This is the blade file

edit.blade.php

<div class="box-footer">
    <button type="submit" class="btn btn-lg col-md-3 btn-primary">..{{ __('adminstaticword.Submit') }}</button>
</div>

post function in the Controller

return back()->with('success',trans('flash.AddedSuccessfully'));

In file web.php

Route::post('admin/class/{id}/addsubtitle','SubtitleController@post')->name('add.subtitle');


Solution 1:[1]

you can use the old() method in input field value attribute just like it

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Danish Mirza