JQuery加载表单不会提交

时间:2013-06-20 17:41:15

标签: php jquery ajax

当我通过Ajax JQuery加载表单时:

$('#quick_feed').load('api/shs/loaders.php?do=ask_question');

表单出现,但问题是当我单击提交按钮时表单不处理提交。这是这个表格

<div class="feed_header">
    <div class="feed_profilepic"><img src="profile_pics/<?php echo $session->profile_pic; ?>" width="50" height="50" class="image3" border="0"></div>
    <div class="feed_postedby"><?php echo $session->full_name; ?></div>
    <div class="feed_posted"></div>
</div>

<div class="feed_header" style="padding-top: 3px;">
<form action="?task=submit" method="POST"><input type="text" style="width:  97.7%; color: #000;" class="box" name="question" value="">
</div>

<div class="feed_header" style="padding-top: 2px;">
<textarea rows="10" name="question_more" id="aboutyou" cols="30" style="resize:none; width: 99%"></textarea>
</div>

<div class="feed_header" style="padding-top: 2px;">
</div>

    <div class="feed_header" style="padding-top: 2px;">
    <div class="feed_buttons" id="ask" style="padding-left: 5px;"><p><input type="submit" value="Ask It"></form></p></div>
<a href="#" onClick="AADS(); return false"><div class="feed_buttons" style="padding-left: 5px; padding-top: 0px;"><p><span class="feed_button" style="background-color:#999; margin-top: 3px;">Cancel</span></p></div></a>
</div>

表单的提交是表单加载的页面。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

从包裹<form>标记的div中删除表单,并在同一级别结束标记:

<form action="?task=submit" method="POST"><input type="text" style="width:  97.7%; color: #000;" class="box" name="question" value="">
   <div class="feed_header" style="padding-top: 2px;">
      <textarea rows="10" name="question_more" id="aboutyou" cols="30" style="resize:none; width: 99%"></textarea>
   </div>

   <div class="feed_header" style="padding-top: 2px;">
   </div>

    <div class="feed_header" style="padding-top: 2px;">
       <div class="feed_buttons" id="ask" style="padding-left: 5px;">
          <p><input type="submit" value="Ask It"></p>
       </div>
       <a href="#" onClick="AADS(); return false">
          <span class="feed_buttons" style="padding-left: 5px; padding-top: 0px;">
              <span class="feed_button" style="background-color:#999; margin-top: 3px;">Cancel</span>
          </span> 
       </a>
    </div>
</form>