I have a form where the data is collected then sent to a PHP page via AJAX. This form has a simple button after the </form> tag, it is a "normal" button on which I listen to a click, then perform my AJAX call.
<button id="normalbutton">Imabutton</button>
Why did I put the button outside ?
Because if the button is inside the <form>...</form> tags, even if my form has no action specified, even if the button is not a submit button, the simple fact of clicking on it refreshes the whole page.
How can I deal with buttons inside my form?
So far, the only solution I found is to remove the <form>...</form> tags, because I handle the submission with jQuery, and I don't need to have a form anymore. Is this correct according to HTML syntax ? i.e. can we have input tags, for instance, without a parent form ? It works, but is it grammatically correct ?