您好,登錄后才能下訂單哦!
jquery提交表單jquery.form.js
jquery.form.js官網下載地址:
http://plugins.jquery.com/form/
教程實例:
http://www.malsup.com/jquery/form/
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" src=" jquery_1.4.2.min . js "></script> <script type="text/javascript" src=" jquery . form . js "></script> <script> $(document).ready(function(){ var options = { target: '#myForm', url: 'test.php', success: function() { alert('Thanks for your comment!'); } }; // 將options傳給ajaxForm $('#myForm').ajaxForm(options); }); </script> <form id="myForm" method="post"> Name: <input type="text" name="name" /> Comment: <textarea name="comment"></textarea> <input type="submit" value="提交" /> </form>
test.php
<?php $name=$_POST['name']; date_default_timezone_set('Asia/Shanghai'); $fp=fopen("check.txt","a"); //$str=date("Y-m-d H:i:s"); fputs($fp,$name); fclose($fp); ?>
中文說明:http://www.open-open.com/lib/view/open1325032463827.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。