-1

I have a form that has one hidden input field, the hidden field includes the value of email. the problem when the button clicked, the form didn't submit any values at all and nothing happens at all.

the HTML form as shown below:

         <form method="post" class="table-responsive" action="alerts.php">
            <?php foreach ($admins as $key => $admin): ?>
            <input type="hidden" name="email" value="<?php echo $admin['email']; ?>">
            <?php endforeach;?>

            <button type="submit" class="btn btn-outline-light btn-lg btn-block  add"
                name="e_conf">confirm</button>

        </form>

i tried to test if the form submit the values or not but set output message in the server side:

if(isset($_POST["e_conf"])){
echo "test";
}

but nothing displayed at all which I understood that the form didn't submit any values. I hope someone can figure out this problem thanks

nurial sj
  • 1
  • 5

1 Answers1

-1

Can you try below jquery code to submit form, Make sure jquery is included in your project.

<script>
$(".add").click(function(){
    $(".table-responsive").submit();
});
</script>
Sachin
  • 397
  • 4
  • 13
  • same problem it doesn't work, I tried to `echo $_POST["email"]` in same page and it worked and display the value without submitting the button. *the server page is included in the main page though* – nurial sj Nov 09 '20 at 13:47