1
I have the following form:
<?php
include "conexao.php";
echo"<form class='navbar-form navbar-left' action='#'>";
echo"DATA INICIAL: <input type='text' name='datainicio' id='datainicio' class='form-control'>";
echo"DATA FINAL : <input type='text' name='datafinal' id='datafinal'class='form-control' >";
echo"OCORRENCIA : <select class='form-control' id='ocorrencia' name='ocorrencia'>";
$result= mysql_query ("SELECT * FROM ocorrencias") or die ("não foi possivel fazer a pesquina no banco");
while ($row = mysql_fetch_assoc($result))
{
$v_oc_id = $row["oc_id"];
$v_oc_desc = $row["oc_desc"];
echo"<option value='$v_oc_id'>$v_oc_desc</option>";
}
echo"</select>";
echo" <button type='submit'class='btn btn-primary'><span class=' glyphicon glyphicon-search'></span></button>";
echo"</form>";
?>
What I need, after the query that the chosen date stays in the field date, as shown in the image, that is after the query the date remains selected.
friend vc can treat the form as html itself and not as echo php, how much the question vc can use the input value so the value coming back from the database appears as you want example:
– Thalles Daniel
vc can use input value so the value coming back from the bank appears as you want example: ---> I didn’t understand it well, could explain it better ?
– Chefe Druida
example <input type='text' name='datafinal' id='datafinal' <?php echo $variaveldobanco['datafinal']? >class='form-control'>
– Thalles Daniel
you want to get the date we see from the bank query or a date you’re sending to the bank?
– Thalles Daniel
The date I am sending - The person puts there the period he wants to consult and with that I need the period to continue there
– Chefe Druida
Now understood the person puts a break and query the type of occurrence is this? If that’s it you can use the post when consulting the test knife, see the answer fill in the date and click on Ubmit. When the page is loaded you can take the post data and return in the inputs
– Thalles Daniel
@otaciojb I just edited my answer forgot the
method='post'
, if any of the answers are correct, consider validating it.– MagicHat