ajax表单提交插件—jQuery Form Plugin

 

ajax表单提交插件—jQuery Form Plugin

 

jQuery表单插件允许您轻松地将HTML表单升级为AJAX表单。插件中的主要方法ajaxForm和ajaxSubmit从表单组件收集信息,以确定如何处理表单提交过程。

 

使用的API:http://malsup.com/jquery/form/#api

 

使用示例代码:

 

<form id=”myForm” action=”comment.php” method=”post”>

Name: <input type=”text” name=”name” />

Comment: <textarea name=”comment”></textarea>

<input type=”submit” value=”Submit Comment” />

</form>

 

表单区:

 

<html>

<head>

<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js”></script>

<script src=”http://malsup.github.com/jquery.form.js”></script>

 

<script>

// wait for the DOM to be loaded

$(document).ready(function() {

// bind ‘myForm’ and provide a simple callback function

$(‘#myForm’).ajaxForm(function() {

alert(“Thank you for your comment!”);

});

});

</script>

</head>

 

 

调用区域: 通过以上的使用,就可以实现表单Ajax技术,是不是很简单。

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容