0

我正在尝试将数据插入表中,将结果显示到不同的 div 中而不刷新,但似乎无法使其工作。当我单击提交按钮时,没有任何反应,页面只是重新加载并且它没有被发送

HTML 和 ASP

<form id="form1" name="form1" method="post" onsubmit=" return Form1_Validator(this)" action="" >
                <table width="442" border="0" align="left" cellpadding="3" cellspacing="3">
                  <tr>
                    <td colspan="6" bgcolor="#50B2FF"><div align="center" class="style4"><strong>Super 4 Set 1</strong></div></td>
                  </tr>
<tr>
  <td colspan="6" bgcolor="#B434E7"><div align="center"><span class="style4"><strong>Please its recommended you select one option against each match</strong></span></div></td>
</tr>
                  <% Dim counter
While ((Repeat1__numRows <> 0) AND (NOT rs_set1.EOF)) 

counter = counter + 1

%>
                   <tr>
                     <td colspan="6" bgcolor="#FF8AFF"><strong>League:<%=(rs_set1.Fields.Item("leg_type").Value)%></strong></td>
                     </tr>
                   <tr>
                <td width="20" bgcolor="#FFCCFF"><input type="radio" name="team<%=counter%>" id="team<%=counter%>" value="<%=(rs_set1.Fields.Item("team1").Value)%>" /></td>
                <td width="126" bgcolor="#FFCCFF"><%=(rs_set1.Fields.Item("team1").Value)%>
                  <input name="super<%=counter%>" type="hidden" id="super<%=counter%>" value="<%=(rs_set1.Fields.Item("game_id").Value)%>" />
                  <input name="bet_type<%=counter%>" type="hidden" id="bet_type<%=counter%>" value="Super 4" /></td>
                <td width="20" bgcolor="#FFCCFF"><input type="radio" name="team<%=counter%>" id="team<%=counter%>" value="<%=(rs_set1.Fields.Item("def_stat").Value)%>" /></td>
                <td width="66" bgcolor="#FFCCFF"><%=(rs_set1.Fields.Item("def_stat").Value)%></td>
                <td width="27" bgcolor="#FFCCFF"><input type="radio" name="team<%=counter%>" id="team<%=counter%>" value="<%=(rs_set1.Fields.Item("team2").Value)%>" /></td>
                <td width="126" bgcolor="#FFCCFF"><%=(rs_set1.Fields.Item("team2").Value)%></td>
              </tr>

                  <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_set1.MoveNext()
Wend
%>
<tr>
                    <td colspan="6" bgcolor="#50B2FF"><div align="center">
                      <input type="image" name="imageField" id="imageField" src="../../imgs/buttons/submit.png" />
                    </div></td>
</tr>
<% If Not rs_set1.EOF Or Not rs_set1.BOF Then %>
  <% If Not rs_set1date.EOF Or Not rs_set1date.BOF Then %>
    <tr>
      <td colspan="6" bgcolor="#FFFFFF"><div align="center"><strong> Expires On: <%= DoDateTime((rs_set1date.Fields.Item("super_bet_over").Value), 1, 2057) %>, <%= DoDateTime((rs_set1date.Fields.Item("super_bet_over").Value), 3, 16394) %></strong></div></td>
    </tr>
    <% End If ' end Not rs_set1date.EOF Or NOT rs_set1date.BOF %>
  <% End If ' end Not rs_set1.EOF Or NOT rs_set1.BOF %>
                </table>
                <div align="center"></div>
                </form>

jQuery

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>

                <script language="javascript">

$('form').submit(function(e){
    e.preventDefault();
    var mm = {a:1000, b:1000, c:1000};
    $.ajax({
        url:"super4_engine.asp",
        data:mm,
        type:"POST",
        success:function(data){

        }
    });
});     
                </script>
4

0 回答 0