i have an ajax form like this:
$(function() {
$('.send').click(function(e) {
$.ajax({
url: 'email.php',
type: 'POST',
data: {
'message': $('.inner').html(),
'email': $('[name="email"]').val(),
'name': $('[name="name"]').val(),
'preis': $('.overallprice').html()
},
success: function(data) {
alert('Ihre Daten wurden erfolgreich gesendet');
}
});
});
});
I want the script to check if someone filled the form correctly (name & mail). Tried to use .checkValidity() but i couldnt get it to work.