text 阿贾克斯

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 阿贾克斯相关的知识,希望对你有一定的参考价值。

<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js"></script>
<script>
    // Wait for the DOM to be ready
$(function() {
  // Initialize form validation on the registration form.
  // It has the name attribute "registration"
  $("form[name='registration']").validate({
    // Specify validation rules
    rules: {
      // The key name on the left side is the name attribute
      // of an input field. Validation rules are defined
      // on the right side
      firstname: "required",
      requirement: "required",
      email: {
        required: true,
        // Specify that email should be validated
        // by the built-in "email" rule
        email: true
      }
    },
    // Specify validation error messages
    messages: {<
      firstname: "Please enter your name",
      email: "Please enter a valid email address",
      requirement: "Please enter your requirement"
    },
    // Make sure the form is submitted to the destination defined
    // in the "action" attribute of the form when valid
    submitHandler: function(form) {
    	$('#btn__submit').hide();
    	$('#btn__sending').show();
      event.preventDefault();
        var a =  $('input[name=choise]:checked').val();
        var b =  $('#firstname').val();
        var c =  $('#company').val();
        var d =  $('#email').val();
        var e =  $('#phone').val();
         var f =  $('#requirement').val();
        $.ajax({
            url: '/offidon/send_mail.php?a=' + a + '&b=' + b + '&c=' + c + '&d=' + d + '&e=' + e + '&f=' + f,
            success: function (data) {

								$( "body" ).addClass( 'showForm' );
								$("html, body").delay(200).animate({
		scrollTop: $('#top').offset().top
}, 200);
                return true;

            }
        });
        return false;
    }
  });
});

    </script>

以上是关于text 阿贾克斯的主要内容,如果未能解决你的问题,请参考以下文章

text 阿贾克斯

text 阿贾克斯·PHP·数据库で情报を取得

返回值是TEXT的阿贾克斯方法

text 为什么良好的沟通至关重要 - 杰弗里麦克斯韦

荷兰之光:阿贾克斯

"阿贾克斯"的作用