Select a selectbox from a click of a table

0

Hello, I'm trying to pass the data from a table pulled from the database to the fields that belong to update on the same page as the one that I registered, but I can only pass the data from the textbox to the page in php.

Below the logic I was using.

$("#selUsuario").on('click', 'tr', function () {
var idUser = $(this).find(':nth-child(1)').text();
var nomeUser = $(this).find(':nth-child(2)').text();
var areaUser = $(this).find(':nth-child(3)').text();
var emailUser = $(this).find(':nth-child(4)').text();
var emiteUser = $(this).find(':nth-child(5)').text();
var origemUser = $(this).find(':nth-child(6)').text();
var masterUser = $(this).find(':nth-child(7)').text();


$(this).siblings().removeClass("marcada");
$(this).toggleClass("marcada");


$("#txtUsuario").val(idUser);
$("#txtNome").val(nomeUser);
    $("#sbSetor").val(areaUser);    
    $("#sbEmite").val (emiteUser);
    $("#sbOrigem").val (origemUser);
$("#sbMaster").val (masterUser);

});

    
asked by anonymous 27.11.2018 / 19:51

0 answers