#How to prevent refresh after form submits?

4 messages · Page 1 of 1 (latest)

teal pike
#

I have a blade form

<form method="POST" action="{{ route('blah-path') }}">
    <input type="text" name="blah" />
    @csrf
    <input type="submit" value="Send" />
</form>

In the corresponding controller function, it have no return statement.

But I noticed, at the end of every submit, the page refreshes. How can you stop it from refreshing?

livid aurora
#

There was a name for this type of questions.

What are you trying to accomplish, and why is there no return on the method that processes that form?

teal pike
#

I want to stay on the page

#

Im trying to make a chat using WS.
In a chat, after you send a message, the page wouldn't refresh <-- that's what Im trying to do