This is the table has the fields the purpose is to click the edit button and clicking the jquery statement that I put above will fill in the fields automatically referring to the line that was clicked
This is what I want to get in the records of the table and put them in a modal in input text and I used the following code (It is working but only for <input type="text">
but for textarea
and combobox
does not work and that's what I want)
<script>
$('body').on("click", ".edit", function() {
$('#alterar_ID').val($(this).parents('tr').find('td').eq(0).text());
$('#alterar_si').val($(this).parents('tr').find('td').eq(0).text());
$('#alterar_nome').val($(this).parents('tr').find('td').eq(1).text());
$('#alterar_data').val($(this).parents('tr').find('td').eq(2).text());
$('#alterar_duracao').val($(this).parents('tr').find('td').eq(3).text());
$('#alterar_tipo').val($(this).parents('tr').find('td').eq(4).text());
$('#alterar_relatorio').val($(this).parents('tr').find('td').eq(5).text());
});
</script>
That is, clicking a button in the table will fetch the values corresponding to the indexes and place them in the modal inputs. My question is the following and if I want to put in a textarea or leave selected a combobox ?