I want to use onclick="myFunction()" on the button to manage the form and then use JS inside the function to submit the form. I don't want the html to make the post request. This has worked before when I have not used a router so I suspect it has something to do with that.
Why does the form make a GET request even without a submit button?
When I look at $_SERVER['REQUEST_METHOD'] after I load the page it is GET. Does it have anything to do with that?
I have a login form that looks like this.
No
form method
, nobutton type="submit"
or anything but the form will still send aGET
request.The router looks like this:
I want to use
onclick="myFunction()"
on the button to manage the form and then use JS inside the function to submit the form. I don't want the html to make the post request. This has worked before when I have not used a router so I suspect it has something to do with that.Why does the form make a
GET
request even without a submit button?When I look at
$_SERVER['REQUEST_METHOD']
after I load the page it isGET
. Does it have anything to do with that?