2017-09-13 117 views
0

我有一個輸入在我的網頁,當我鍵入任何名稱,它與ajax鏈接,它在我的數據庫中搜索該名稱,並返回結果作爲HTML表單所有的輸入都具有表格數據庫的值,在這種形式下,我放置了一個不起作用的提交按鈕。Ajax:PHP的HTML提交按鈕不工作在AJAX響應

我的代碼: HTML

<div class="well"> 
    <input type="text" name="promote_student_txt" id="promote_student_txt" /> 
    <div id="rr2"></div> 
</div> 

AJAX

$('#promote_student_txt').keyup(function(){ 
    var email = $('#promote_student_txt').val(); 
    $.post('includes/promote_student_search.php',{e:email},function(data){ 
     $('#rr2').html(data); 
}); 
}); 

PHP頁面

<td> 
     $id="FROM DATABASE"; 
     $class="FROM DATABASE"; 
     $section="FROM DATABASE"; 
     <form method='get' action='new.php'> 
      <input type='hidden' name='student_id' value='$id' /> 
      <input type='hidden' name='old_class' value='$class' /> 
      <input type='hidden' name='old_section' value='$section'/> 
      <input type='submit' name='promote_single'/> 
     </form> 
    </td> 
+0

你的提交函數是由jQuery處理的嗎? –

+0

沒有它的簡單提交按鈕。 –

+0

如果是這種情況,那麼「不工作」並不能告訴我們多少。什麼是「不工作」? –

回答