W
W
wipe00092021-07-05 11:45:30
JavaScript
wipe0009, 2021-07-05 11:45:30

Is it possible to use a stub form to be able to use required?

I want to be able to use required which will point the user to an empty field, but I have to send the information to the server via fetch and not via the form. If I just wrap the inputs (with required) in a dummy form <form onsubmit="submit" action="" method="POST">and assign a button with the submit type - when the button is pressed, the page reloads. How can I make it so that it does not reboot

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-07-05
@wipe0009

preventDefault

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question