How to open a bootstrap modal box after submitting a form by barcode scanner
<p>I have a small form for barcode scanning. I scan the barcode of a product and a bootstrap box will appear. Into the modal i post barcode number of product. And inside the modal there is another form, which will retrieve barcode number of product and will fill some inputs and insert it into the mysql database table. </p>

<pre><code>&lt;form name="barkod_oku" id="barkod_oku" action="" method="post" &gt;
&lt;input name="sto_barkod" id="sto_barkod" value="" autofocus placeholder="Barkod Numarası"&gt;
&lt;input type="hidden" name="alis_fatura_no" value="&lt;?php echo $finalcode1 ;?&gt;"&gt;

&lt;/form&gt;
</code></pre>

<p>This is the form which i post 2 values into the modal box. </p>

<p>And this is the modal box which i want to see. ( İ haven't put otehr inputs into the modal yet.Later i will put.)</p>

<pre><code> &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
 &lt;div class="modal-dialog"&gt;
 &lt;div class="modal-content"&gt;
 &lt;div class="modal-header"&gt;
    &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
    &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
    &lt;input name="barkod_no" value="&lt;?php echo $sto_barkod1; ?&gt;"&gt;
    &lt;input name="fatura_no" value="&lt;?php echo $stok_kodu1; ?&gt;"&gt;
  &lt;/div&gt;
   &lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
</code></pre>

<p>And also i use this javascript to open the modal box:</p>

<pre><code> &lt;script&gt;
 $('#barkod_oku').submit(function () {

    $('#myModal').modal('show');
 });
&lt;/script&gt;
</code></pre>

<p>Shortly everything works fine i think but modal is not staying on the screen. It appears and then disappears in one second. What is the missing point that i can not see to hold the modal on screen?</p>