div
appears as soon as I submit the form without updating the page, I already tried some javascript and jQuery codes that did not work. Can anyone help me?
This and the form to enter the data:
<form action="" method="post" id="meufrm" enctype="multipart/form-data">
<fieldset>
<legend style="color: #ffffff" class="btn btn-inverse">Cadastro </legend>
<label for="nome" style="color: #000"><strong>Nº da Venda :</strong> </label>
<input type="number" name="num_venda"></br></br>
<div id="datavenda">
<label for="nome" style="color: #000"><strong>Data :</strong> </label>
<input type="date" name="data_venda"></br></br>
</div>
<div id="placavenda">
<label for="nome1" style="color: #000"><strong>Placa :</strong> </label>
<input type="text" name="placa" ></br></br>
</div>
<div id="kmvenda">
<label for="imagem" style="color: #000"><strong>KM : </strong></label>
<input type="number" name="km"></br></br>
</div>
<?php
mysql_connect('127.0.0.1','root','');
//escolher a base de dados
mysql_select_db('mecanica');
$query='Select * from produtos';
?>
<label for="produtos" style="color: #000"><strong>Produto : </strong></label>
<select name="produtos">
<?php
$resultado=mysql_query($query);
while($linha=mysql_fetch_array($resultado))
{
echo '<option value="' . $linha['id_produto'] . '">' . $linha['produtos'] . '</option>';
}
echo '</select>';
?>
</select><br><br>
<div id="servicovenda">
<?php
mysql_connect('127.0.0.1','root','');
mysql_select_db('mecanica');
$query='Select * from servicos';
?>
<label for="servicos" style="color: #000"><strong>Serviços : </strong></label>
<select name="servicos">
<?php
$resultado=mysql_query($query);
while($linha=mysql_fetch_array($resultado))
{
echo '<option value="' . $linha['id_servico'] . '">' . $linha['servicos'] . '</option>';
}
echo '</select>';
?>
</select><br><br>
</div>
<div id="enviarvenda">
<input type="submit" class="btn btn-inverse" value="Enviar" name="send" >
<a href="listadevendas.php" class="btn btn-inverse" >Cancelar</a>
</div>
</fieldset>
As soon as I send the data I would have to list the results of the hidden div on the same page