0

请我是 asp.vb 开发人员和 jquery mobile 的新手。我有一个页面,我想使用 jquery mobile 将数据从它插入到 ms access 数据库中。请问只有一个有帮助吗?这是我的html:

<form id="form1" name="form1" method="post" action="sources/quest_rev.asp">
          <table width="525" border="0" cellpadding="3" cellspacing="3">
            <tr>
              <td width="59"><strong>Reply</strong></td>
              <td width="445"><textarea name="reply" cols="60" id="reply"></textarea></td>
            </tr>
            <tr>
              <td><strong>Name</strong></td>
              <td><input type="text" name="uname" id="uname" /></td>
            </tr>
            <tr>
              <td><strong>Number</strong></td>
              <td><input type="text" name="unumber" id="unumber" /></td>
            </tr>
            <tr>
              <td><strong>Location</strong></td>
              <td><label for="location"></label>
              <input type="text" name="location" id="location" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><input type="submit" name="button" id="button" value="  Send  " /></td>
            </tr>
          </table>
        </form>
4

2 回答 2

0

提交表单时,需要向服务器发送ajax请求,服务器应将表单数据保存到ms access数据库中。

jQuery 无法向数据库中插入任何数据

jQuery(function($){
    $('#form1').submit(function(){
        $.ajax({
            url: '<url>',
            type: 'POST',
            data: $(this).serialize()
        }).done(function(data){
            //do something
        });
        return false;
    })
})
于 2013-07-11T08:54:34.700 回答
0

这可以帮助你做你想做的事:http://www.aspsnippets.com/Articles/Send-and-Receive-JSON-objects-to-Web-Service-Methods-using-jQuery-AJAX-in-ASPNet。 aspx

于 2013-07-11T08:56:48.143 回答