Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zaster's avatar

wire:submit.prevent vs wire.submit

What is the difference between wire:submit.prevent vs wire.submit

They both submits the form without any issue.

I know that wire:submit.prevent is the one to use

But why?

Edit : Is it to prevent the page refresh when a form submission is done

0 likes
2 replies
SilenceBringer's avatar

@zaster it is to prevent default form submition. When you prevent default action - you are responsible to process the form. But if you do not prevent - you method will be executed AND form will be submitted (how general form submition works)

Snapey's avatar
Snapey
Best Answer
Level 122

Just to prevent the default behaviour of the submit button which would be to submit the form

Please or to participate in this conversation.