1
I have a main page with a simple form:
<div class="col-sm-6">
<label for="tipo">Tipo de sessão:</label>
<select class="form-control" name="tipo">
<option value="1">opcao 1</option>
<option value="2">opcao 2</option>
</select>
</div>
<div class="col-sm-6">
<label for="data">Data:</label>
<input type="date" class="form-control" name="data" required>
</div>
<div class="col-sm-3">
Funcionario
<div class="card">
<img class="card-img-top" src="..." alt="Funcionario">
<div class="card-body">
<h5 class="card-title">Funcionario</h5>
<a href="#" class="btn btn-primary">Selecionar...</a>
</div>
</div>
</div>
I have another page that lists employee items:
while ($sessao = mysqli_fetch_assoc($result)){
echo '<div class="media col-sm-6">
<div class="media-body">
<h2 class="mt-0">'.$sessao['nome'].'</h2>
<a class="btn btn-primary" href="DEVERIA SELECIONAR AQUI.php?id='.$sessao['id'].'">Seleciona</a>
<a class="btn btn-danger" href="deleteFlor.php?id='.$sessao['id'].'">Excluir</a>
</div>
</div>';
}
?>
How to make the first page open the second (being a MODAL) and the second page, when selecting the employee, it is displayed on the first screen?
There’s probably something like this already in the community, but since I don’t know the name of this technique, I’m asking the question.
Let me see if I understand, you select on the fixed page, open the modal, select in the modal and the result appears on fixed?
– Wees Smith
That’s right they Smith
– Italo Rodrigo
using
$.ajax()
, when you select the employee, in the return functionsuccess
vc inserts the data on the fixed page.– Wees Smith
and closes the modal
– Wees Smith