バーコードスキャン用の小さなフォームがあります。製品のバーコードをスキャンすると、ブートストラップ ボックスが表示されます。モーダルに製品のバーコード番号を投稿します。モーダル内には別のフォームがあり、製品のバーコード番号を取得し、いくつかの入力を入力して mysql データベース テーブルに挿入します。
<form name="barkod_oku" id="barkod_oku" action="" method="post" >
<input name="sto_barkod" id="sto_barkod" value="" autofocus placeholder="Barkod Numarası">
<input type="hidden" name="alis_fatura_no" value="<?php echo $finalcode1 ;?>">
</form>
これは、モーダル ボックスに 2 つの値を投稿するフォームです。
そして、これが私が見たいモーダルボックスです。( İ 他の入力をまだモーダルに入れていません。後で入れます。)
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<input name="barkod_no" value="<?php echo $sto_barkod1; ?>">
<input name="fatura_no" value="<?php echo $stok_kodu1; ?>">
</div>
</div>
</div>
</div>
また、このJavaScriptを使用してモーダルボックスを開きます:
<script>
$('#barkod_oku').submit(function () {
$('#myModal').modal('show');
});
</script>
まもなくすべてが正常に機能すると思いますが、モーダルが画面に表示されません。1秒で現れては消える。モーダルを画面に保持するのに見えない欠けている点は何ですか?