Note that there are some explanatory texts on larger screens.

plurals
  1. POsubmit form to itself without page refresh and hide/show the div after submit
    primarykey
    data
    text
    <p>is it possible to submit form without refresh and hide the current div, show the div which is hidden.</p> <p>I tried using following code which submits a form and reloads page.</p> <pre><code>&lt;form method="post" name="searchfrm" action="schedule.php" &gt; &lt;div&gt;&lt;input type="text" placeholder="Patient Lastname" class="pName" id="pName" name="pName" /&gt;&lt;/div&gt;&lt;/br&gt; &lt;div&gt;&lt;input type="text" placeholder="Surgeon Name" class="sName" id="sName" name="sName" /&gt;&lt;/div&gt;&lt;/br&gt; &lt;div&gt; &lt;span&gt;&lt;input type="text" placeholder="mm" class="mm" name="mm" /&gt;&lt;/span&gt; &lt;span&gt;&lt;input type="text" placeholder="dd" class="dd" name="dd" /&gt;&lt;/span&gt; &lt;span&gt;&lt;input type="text" placeholder="yyyy" class="yyyy" name="yyyy" /&gt;&lt;/span&gt; &lt;span&gt;&lt;input type="button" class="sButton" id="sButton"/&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p></p> <pre><code> &lt;!-- Search Results --&gt; &lt;div id="searchDiv" class="searchDiv" style="display:none;"&gt; &lt;?PHP $dateVal = $_POST["yyyy"]-$_POST["mm"]-$_POST["dd"]; $sName = $_POST["sName"]; $pName = $_POST["pName"]; echo "dateVal".$sName; $ser_val=@mysql_query("SELECT * FROM issio_patient_procedures WHERE procedure_date='$dateVal' AND asc_id='$ascId' AND surgeon_name='".$sName."' "); if(@mysql_num_rows($ser_val)&gt;0) { $se_count=0; while($se_count_det=@mysql_fetch_assoc($ser_val)) { $se_count++; echo $se_count_det["surgeon_name"]; } } ?&gt; &lt;/div&gt; &lt;!-- Search Results End --&gt; &lt;div class="scroll" id="scroll" style="display:block;"&gt; &lt;div class="dateHeader"&gt; Some content.... &lt;/div &lt;/div </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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