I want to create a email contact form without refreshing the page. So i added jquery im my html file. I used html required attribute ti check if the fields are empty. But when i
You are sending the AJAX request when the user clicks on the button, not when they submit the form. Change .click() to .on('submit') and attach it to the form, not the button:
$('#mycontactform').on( 'submit', function () {
...