Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax block my form to submit
    text
    copied!<p>I have create a form for listing promotion in hotel, and I got ajax for search the promotion by check in and check out date. My promotion list have a submit button for booking. </p> <p>When my page load, I just retrieve the promotion list from database with some random date, and I got search form for user use to filter the promotion by using ajax submit but when ajax trigger, the booking button is not submit.</p> <p>Please help me. Thanks in advance</p> <p>This is the ajax code:</p> <pre><code>$("#submitform").click(function(){ $.ajax({ data:$("#checkpromofrm").serialize(), url:'&lt;?php echo '/'.APP_ROOT.'/promotion/checkpromotion'?&gt;', type:"POST", success:function(respone){ $('#hideform').html(respone); } }); return false; }); </code></pre> <p>And this is my search form:</p> <pre><code>&lt;form name="frmrate" action="" id="checkpromofrm"&gt; Check-in &lt;input type="text" id="popupDatepicker" style="width:100px;" name="txtstartdate" value="&lt;?php $currentdate = date('d-M-Y', strtotime('1 days')); echo $currentdate; } ?&gt;"/&gt; Check-out: &lt;input type="text" id="elapsed" style="width:140px;text-align:left; border:none;padding-left:0px;" value="&lt;?php $currentdate = date('d-M-Y', strtotime('2 days')); echo $currentdate; } ?&gt;" readonly="readonly" name="EndDateCheckRate"/&gt; &lt;input type="submit" id="submitform" value=" Check" name="" /&gt; &lt;/form&gt; </code></pre> <p>This is my promotion list:</p> <pre><code>&lt;form action="&lt;?php echo '/' . APP_ROOT . '/'; ?&gt;promotion/&lt;?php echo $newroom['h_id']?&gt;/hotel" method="post"&gt; &lt;tr id="songlist"&gt; &lt;td width="100"&gt; &lt;img src="&lt;?php echo '/'.APP_ROOTAdmin.'/'.$newroom['r_picpath'];?&gt;" align="left" /&gt; &lt;/td&gt; &lt;td &gt; &lt;p&gt;&lt;span style="color:#1A7CBC;font-weight:bold;"&gt; &lt;input type="hidden" name="r_cat" value="&lt;?php echo $newroom['r_cat']; ?&gt;" /&gt; &lt;input type="hidden" name="brf" value="&lt;?php $newroom['brf'] ?&gt;" /&gt; &lt;?php echo $newroom['r_cat'];?&gt; Single&lt;/span&gt; &lt;font&gt;&lt;b&gt; &lt;i&gt;&lt;br /&gt; &lt;?php if($newroom['brf']=='0') { echo "Breakfast not included"; } else { echo "Breakfast included";}?&gt; &lt;/i&gt;&lt;/b&gt; &lt;/font&gt; &lt;/p&gt; &lt;/td&gt; &lt;td align="center" valign="middle"&gt; &lt;input type="hidden" name="txthid" value="&lt;?php echo $HoDetail['h_id']; ?&gt;" /&gt; &lt;input type="hidden" name="txtrid" value="&lt;?php echo $newroom['r_id']?&gt;" /&gt; &lt;input type="submit" class="bookbutton red" value="Book now" onclick="return check(num);" /&gt;&lt;br /&gt; Only &lt;?php echo $newroom['s_room']?&gt; rooms left &lt;/td&gt; &lt;/tr&gt; &lt;/form&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload