1
Hello, I would like to enter information that is in a database based on the value that the select is selected.
Based on the value that the 'professional' input had appeared the services that are registered in the database.
I saw some posts using Ajax, Javascript, but I could not adapt to my code, if someone can give a strength. If you need more information just let us know.
Thanks in advance.
<form action="pages/inserts/insertagendamento.php" name="agendamento" method="post">
<label for="data">Data:</label>
<input id="data" name="data" type="date" min="<?php echo date('Y-m-d'); ?>">
<label for="hora">Hora:</label>
<input type="time" id="hora" name="hora">
<label for="duracao">Duração:</label>
<input type="time" id="duracao" name="duracao" placeholder="h:m"><br>
<label for="profissional">Profissional:</label>
<select id="profissional" name="profissional">
<option =value="">Selecione a Profissional</option>
<?php
include ("conexao.php");
$query = "SELECT * FROM profissionais";
$pesquisa = mysqli_query($conn, $query);
while($exibe = mysqli_fetch_array($pesquisa)) {
echo "<option value=" . $exibe["profissionais_id"] . "> ". $exibe["profissionais_nome"] . "</option> ";
}
?>
</select><br>
<label for="servico">Servico:</label>
<select id="servico" name="servico">
<option value="">Selecione o serviço</option>
Aqui seria oq preciso preencher
</select>
Cliente: <input type="text" name="cliente"><br>
<input type="submit" value="Cadastrar">
</form>
Thanks a lot brother, it worked out here, with this code your was much easier to understand (:
– Raphael
and as for security without problem, it is a system that I am doing only for 'domestic' let’s say so, but thank you again
– Raphael
Ah show then bro! happy to help :)
– andre_luiss