0
how can I run this script below, at the time the input label is filled?
<script>
$(document).ready(function(){
var serie = $('#serie_maquina').val();
var grupo = $('#grupo_maquina').val();
console.log(serie);
console.log(grupo);
$.ajax({
type:'post',
url: 'info_maquina_consulta.php',
data: {
'serie':serie,
'grupo':grupo
},
erro: function(){
alert('erro');
},
success: function(data){
$("#maquina_carrega").html(data);
}
});
});
EDIT1 follows html as request:
<form>
<div class="col-sm-6">
<div class="input-group input-group-md">
<span class="input-group-addon" id="sizing-addon1">Numero Serie</span>
<input type="text" class="form-control" name="serie_maquina" id="serie_maquina">
</div>
</div>
<div class="col-sm-6">
<div class="input-group input-group-md">
<span class="input-group-addon" id="sizing-addon1">Modelo</span>
<input type="text" class="form-control" name="grupo_maquina" id="grupo_maquina">
</div>
</div>
<button id="btn_consulta" type="button" class="btn btn-md btn-success">Pesquisar</button>
</form>
What would be input label?
– Marcus Vinicius
Adding HTML will make the problem easier to understand
– Sveen
edited the post with html!
– TiredMonkey
Assuming I have a button that receives a value="from a query. "how do I pass this value to a php variable in a modal?
– TiredMonkey
In case, you no longer want to be executed when opening the page?
– Sam
I ask you to rework the question because your original post poses a question and then here in the comments you question something else. With that, it is not clear the question to which you really seek answer.
– Caiuby Freitas