What is the default behavior when we submit an HTML form?
Hello, consider the following code:
My question is, if we let the form as it is in its default behavior, what happens when we click on the submit button?
Say I have a server running on localhost. When I press the button, am I redirected to
If we want to prevent a page redirection or page refresh, is there a particular attribute we should add on the form element or we should prevent the form default behavior using javascript, then use
My question is, if we let the form as it is in its default behavior, what happens when we click on the submit button?
Say I have a server running on localhost. When I press the button, am I redirected to
./submit_page or the page refresh but the data is sent to the route ./submit_page and it's the job of my server to handle the incoming data?If we want to prevent a page redirection or page refresh, is there a particular attribute we should add on the form element or we should prevent the form default behavior using javascript, then use
fetch() to send the appropriate data?