3
I have a bar code entry form of the company’s fiscal notes, which has fields as driver, used car on delivery and etc. So that at the time of entry, the user does not need to fill in the information for each note, I use:
body onload='window.history.back();'
Thus, the form is already filled in with the previous information.
It turns out that the specific field for the barcode also returns filled in, causing users to need to delete it to read the next code.
Does anyone know how I can reload the page only with this field of clean bar code? I’m a beginner in PHP
, javascript
and such...
Edit:
Follow my form:
<form action="verif_codigo.php" method="POST">
<!-- Select Motoristas -->
<select class="form-control" name="motorista">
<option value="0">Selecione o motorista...</option>
<option value="1">Opção 1</option>
<option value="2">Opção 2</option>
<option value="3">Opção 3</option>
</select>
<!-- Select Carros -->
<select class="form-control" name="carro">
<option value="0">Selecione o carro...</option>
<option value="1">Opção 1</option>
<option value="2">Opção 2</option>
<option value="3">Opção 3</option>
<option value="4">Opção 4</option>
</select>
<!-- Input Código de Barras -->
<input class="form-control" type="text" id="codigo" name="codbarras" placeholder="Digite aqui o código de barras da NF-e..."/>
<input class="form-control btn btn-primary btn-sm" type="submit" value="Gravar"/>
<input class="form-control btn btn-warning btn-xs" type="reset" value="Limpar"/>
</form>
I have this form, when the user clicks on Submit, the data writes to the database and the form reloads using the body onload
I quoted before. Only the form reloads all filled, and I need the field codbarras
reload blank, so that the user only reads the next code without having to delete the field.
The best I could do at the moment was use:
onclick="document.getElementById('codigo').value='';"
In the input
country codbarras
, only this only erases if you click on the field...
Your question is interesting, but it is incomplete to get an answer. Post the form and the javascript code that applies the conditions to it.
– Andrei Coelho