i have problem with my modal show. how can i show my modal when i click submit? please fix my code
output success without modal. but if i use modal popup its show nothing.
this is my body html
<form action="" method="post">
<div class="row">
<div class="offset-4 col-sm-8 mt-5">
<input type="checkbox" name="hobby[]" value="Sepak Bola"> Sepak Bola <br>
<input type="checkbox" name="hobby[]" value="Membaca"> Membaca <br>
<input type="checkbox" name="hobby[]" value="Menulis"> Menulis <br>
<input type="checkbox" name="hobby[]" value="Memancing"> Memancing <br>
</div>
</div>
<div class="row">
<div class="offset-5 col-sm-7">
<input type="submit" name="proses" class="btn btn-primary" value="Proses" data-toggle="modal" data-target="#exampleModal">
</div>
</div>
</form>
this is my modal show :
<!-- AWAL MODAL -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="offset-4 col-sm-8 mt-5">
<h3>OUTPUT : </h3>
<?php
if (isset($_POST['proses'])) :
if (!empty($_POST['hobby'])) :
foreach ($_POST['hobby'] as $selected) :
echo $selected . "</br>";
endforeach;
endif;
endif;
?>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!-- AKHIR MODAL -->
without modal success output. if use modal it show nothing. please fix this
Aucun commentaire:
Enregistrer un commentaire