When I try to pass the value of a select to an onChange function, by clicking on the button it gives the following error in the console:
[Violation] Added non-passive event listener to scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive.
ERROR CODE (page where data is searched)
<?php
//Conectando ao banco de dados
$con = new mysqli("localhost", "root", "", "tcc");
if (mysqli_connect_errno()) trigger_error(mysqli_connect_error());
//Consultando banco de dados
$qryLista = mysqli_query($con, "SELECT * FROM postagens");
while($r = mysqli_fetch_assoc($qryLista)){
?>
<table id='tabela'>
<tr>
<td><?= $r['id'] ?></td>
<td><?= $r['nome'] ?></td>
<td><?= $r['rua'] ?></td>
<td><?= $r['bairro'] ?></td>
<td><?= $r['telefone'] ?></td>
<td><?= $r['descricao'] ?></td>
<td>
<select id='sel1'>
<option value='status'><?= $r['status'] ?></option>
<option value='pendente'>Pendente</option>
<option value='recolhido'>Recolhido</option>
</select></td>
</table>
<?php
}
?>
excerpt page where the javascript function is
<script src="source\jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function () {
$('.sel1').on('change', function () {
var selecionado = $(this).val();
var selecionado_id = $(this).attr('data-id');
$.ajax({
data: "id=18&selecionado=recolhido",
type: 'post',
url: 'status.php',
});
});
</script>
<script>
// REFRESH FUNCTION ON THE PAGE
function load() {
$("#tabela").load("getdados.php", null, function () {
$(".loading-div").hide();
});
};
$(document).ready(function () {
load();
setInterval(function () {
load();
}, 8000);
});
</script>
</head>
Bem vindo
<?php echo $nome;?> <p>
<?php echo $email;?><p>
<a href="sair.php">Sair</a></p>
<body>
<div class ="container-fluid">
<table class="table table-hover">
<thead>
<tr>
<td>id</td>
<td>nome</td>
<td>rua</td>
<td>bairro</td>
<td>telefone</td>
<td>materiais</td>
<td>Status</td>
</tr>
<tbody id="tabela">
</tbody>