Why the blank feedback form is sent?

Why you can send a blank forum when using attribute "required"?
Or JS you need to add the constraint?
JS
spoiler
$(document).ready(function() {

 $("#ma1, #ma2,#ma3, #ma4").submit(function() {
$.ajax({
 type: "POST",
 url: "form-handler.php",
 data: $(this).serialize()
 }).done(function() {
$(this).find("input").val("");
 alert("Thank you for the request! Soon we will contact you.");
 $("#ma1, #ma2,#ma3, #ma4").trigger("reset");
});
 return false;
});

});

HTML
spoiler
<input type="text" name="name" required placeholder="Your name"> <input type="text" name="mail" required placeholder="Your email"> <input type="text" name="comment" required placeholder="Message"> <input type="submit" onclick="yaCounter" ; required return true;" value="Send">

PHP
spoiler
<?php
$name = htmlspecialchars($_POST['name'] );
$mail = htmlspecialchars($_POST['mail'] );
$comment = htmlspecialchars($_POST['comment']);

$text = <<<EMAILTEXT
From the website the application was received with the following data: 
Name: {$name}
Email: {$mail}
Message: {$comment}
EMAILTEXT;
$result = mail("mail@gmail.com","New application",$text);
if ($result) {
echo "<p--> Message sent successfully!<p></p>";
}
 else {
 echo "<p> Message sent !</p>"; 
 } 
?>
June 10th 19 at 16:23
2 answers
June 10th 19 at 16:25
Because of an error in the js in the markup... How can it work? AI which will all understand - do not invent ever!
In quotes on there, and generally complete well.

PS And as I have a phone code to helicity without switching to the full version of the page??
Where exactly is the error? - Katherine_Hickle commented on June 10th 19 at 16:28
Phew... #ma1.... For them is not installed .on("reset" So the trigger cannot be using.
yaCounter"; required return true;" val
Here.
Why onclick on on and return? Well you the listener hung on the submit event - Leda15 commented on June 10th 19 at 16:31
Simply call the reset method for forms - Leda15 commented on June 10th 19 at 16:34
I our submission removed, just forgot too clean. I accidentally added.

#ma1.... For them is not installed .on("reset" So the trigger cannot be using.

And how to install? - Katherine_Hickle commented on June 10th 19 at 16:37
Don't! Well I say method....
In short here it is:
$("#ma1, #ma2,#ma3, #ma4")[0].reset();
Or individually if the lot doesn't work. - Leda15 commented on June 10th 19 at 16:40
June 10th 19 at 16:27
Look compatible with your version of browser.
And why a bunch of form with id, if all the margins the same? Not the easier class to call and not to produce a bunch of id?

Find more questions by tags HTMLPHP