Don't want to close modal after submitting data in modal PHP
P粉940538947
P粉940538947 2023-09-04 14:35:19
0
1
537
<p>I want to keep the same pattern after submitting this form</p> <p><code>generateBarcode.php</code>:</p> <pre class="brush:php;toolbar:false;"><form action="savegenarateBarcode.php?id=<?php echo $d1; ?>" method="post"> ;</pre> <p><code>savegenerateBarcode.php</code>:</p> <pre class="brush:php;toolbar:false;"><?php try { session_start(); include('../connect.php'); $d1 = $_GET['id']; $b = $_POST['serialnumber']; $sqlm = "select *from product_item where serialnumber='".$b."'"; $query = $db->prepare($sqlm); $user_array = $query ->execute(); }</pre> <p>How can I keep <code>generateBarcode.php(modal)</code> unchanged after submitting this form? </p>
P粉940538947
P粉940538947

reply all(1)
P粉222320176

I think you should use ajax because the form submit method reload the page.

var id = '<?php echo $d1; ?>';
$("#submit").click(function(){
        $.ajax({
            type: 'GET',
            url: "savegenarateBarcode.php",
            data:`id=${id}`
            success:function(data){
             alert(data);
            }
        });
    return false;
    });
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template