No, you can't.
What you can do though is remove the button from the DOM and replace it with something that won't submit the form.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a button that simply submits the form when user has filled out the required fields. After user have submitted, the button is disabled.
Since the html is shown in client-side, everyone has the ability to access "Inspect Element" and manually remove disabled, thereby submit the form.
Is there a way I can prevent the user from doing this?
I use ternery statement to disable the button.
{{ ($status > 0 ? 'disabled' : '') }}
Nope, you can't trust the users on the client-side (frontend), therefore perform additional validation on the backend.
Please or to participate in this conversation.