Html Form Not Submitting Data?
Solution 1:
Change this line,
<form name="register" action="register.php" id="contactForm" method="POST">
you must use method="POST"
instead of type="POST"
Solution 2:
As well as the post method, input fields should also have a name attribute.
Solution 3:
Make sure you submit button is of type submit rather than type button.
Solution 4:
If your form is not submitting and you have checked the suggestions in the previous answers then its probably that you have multiple form ending tags, overlapping form tags or incorrectly closed divs.
Here's a checklist for you which are standard and not php purely based, something you could have a look at in case you still experience this issue:
Check you have a valid action element in your form tag eg:
action="/subjects"
Check you have a valid method element (not a type element) eg:
method="post"
Opening and closing
<form>
tags and a submit button placed within these tags. Make sure that there are no extra divs causing incorrect closing of elements. - DOUBLE CHECK THIS AS IT IS THE MOST COMMON CAUSE OF MANY HEADACHESOverlapping Form tags. (Make sure that you don't have multiple form closing tags, etc)
post is being sent but there is an error in the backend/server/api which is not returning an error or success message to the browser? (Check Network section or browser after pressing
F12
)
If your problem still happens then consider trying to use javascript instead of html form submission for instance. By adding an onclick
event to a button and writing the form.submit function.
I've never heard of any different form submit errors which are not logged in the console or which you can see in the Network section of your browsers development toolbar. Curious to know of your problem in the end.
Solution 5:
The valid attribute for the form is method
not type
method = 'post'
Post a Comment for "Html Form Not Submitting Data?"