I want to prevent my Modal window to close after I push submit Form button.
I tried a different kind of ways jquery/credform/javascript etc and nothing gave me the result I want.
Inside my Modal, as you can see I have a Form with different things. All fields are requested by my PHP server.
Please help me out with this. I want it after I push submit to remain open so the user that completes the form get's a message inside a box that I made there
$('#myModal').on('hidden.bs.modal', function() {
this.modal('show');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<div id="myModal" class="modal hide fade" 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">×</button>
<h4 class="modal-title">Comanda prin Email</h4>
</div>
<div class="modal-body">
<?php include('forms.php'); ?>
<div class="container">
<form id="contact" action="<?= htmlspecialchars($_SERVER["PHP_SELF"]) ?>" method="post">
<div class=""><p style="text-align: center;">Dupa plasarea comenzi in maximum 24 ore ve-ti fi contactat Telefonic pentru confirmarea acesteia!!!</p></div>
<fieldset>
<sup>*</sup>
<input placeholder="Nume Produs" type="text" name="numeprodus" value="<?= $numeprodus ?>" tabindex="1" autofocus>
<span class="error"><?= $numeprodus_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Marimea" type="text" name="marime" value="<?= $marime_produs ?>" tabindex="2" autofocus>
<span class="error"><?= $marime_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Numele" type="text" name="nume" value="<?= $nume ?>" tabindex="3" autofocus>
<span class="error"><?= $nume_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Prenumele" type="text" name="prenume" value="<?= $prenume ?>" tabindex="4" autofocus>
<span class="error"><?= $prenume_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Adresa" type="text" name="adresa" value="<?= $adresa ?>" tabindex="5" autofocus>
<span class="error"><?= $adresa_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Oras" type="text" name="oras" value="<?= $oras ?>" tabindex="6" autofocus>
<span class="error"><?= $oras_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Cod Postal" type="text" name="codpostal" value="<?= $codpostal ?>" tabindex="7" autofocus>
<span class="error"><?= $codpostal_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Email" type="text" name="email" value="<?= $email ?>" tabindex="8">
<span class="error"><?= $email_error ?></span>
</fieldset>
<fieldset>
<sup>*</sup>
<input placeholder="Numar Telefon" type="text" name="telefon" value="<?= $telefon ?>" tabindex="9">
<span class="error"><?= $telefon_error ?></span>
</fieldset>
<fieldset>
<textarea value="<?= $message ?>" name="message" tabindex="10">
</textarea>
</fieldset>
<fieldset>
<button name="submit" type="submit" id="contact-submit" data-submit="...Sending">Submit</button>
</fieldset>
<div class="success"><?= $success ?></div>
</form>
</div>
</div>
<div class="dv-atentionare"><p class="dv-att-p1">Atentie!</p><p class="dv-att-p2">Aveti la dispozitie 48 ore de la plasarea comenzi pentru a o putea anula!</p></div>
<div class="modal-footer">
<input class="btn btn-default">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
Thank you in advance!