weixin_33743880 2016-02-10 15:29 采纳率: 0%
浏览 42

jQuery公式验证

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.

  • 写回答

2条回答 默认 最新

  • helloxielan 2016-02-10 15:37
    关注

    you can use jquery validation here an example

    评论

报告相同问题?