Html form not submitting data?

前端 未结 7 2089
北海茫月
北海茫月 2021-01-14 00:54

Does anyone have an idea of why my HTML form does not submit anything? Once I click the submit button it does nothing? No idea what is going on, have checked everything and

7条回答
  •  灰色年华
    2021-01-14 01:28

    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:

    1. Check you have a valid action element in your form tag eg: action="/subjects"

    2. Check you have a valid method element (not a type element) eg: method="post"

    3. Opening and closing

      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 HEADACHES

    4. Overlapping Form tags. (Make sure that you don't have multiple form closing tags, etc)

    5. 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.

提交回复
热议问题