-1
I cannot call the modal without having to click the button. I would like a modal to appear according to the "Check availability" If true = modal appear with message that it has been successfully registered If return false = modal saying error.
if (!empty($_POST['nome_prova'])){
$prova = ($_POST['nome_prova']);
$data_prova = explode('/',($_POST['data_prova']));
$requerente = ($_POST['requerente']);
$num_acessos = ($_POST['numero']);
$data_prova = $data_prova[2].'-'.$data_prova[1].'-'.$data_prova[0];
if ($reservas->VerificarDisponibilidade($prova, $data_prova, $requerente, $num_acessos)){
$reservas->reservar($prova, $data_prova, $requerente, $num_acessos);
MODAL DE SUCESSO AQUI
} else {
?>
MODAL DE ERRO AQUI
<?php
}
}
?>
<!-- Modal Structure -->
<div id="modal1" class="modal modal-trigger">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Agree</a>
</div>
</div>
Good morning Lucas, thank you so much for trying to help! But I still couldn’t. The modal just won’t open. When I put it to open by clicking the button opens normally. So I discarded something related to the js of materialize. I’m really not getting to open it with decision instead of clicking button
– Erick
Exchange . modal(); for . modal('open'); or . modal('show');
– Lucas Macedo