3
I have a table that has the Material ID and the Name, the name is a link, I need to make when I click the link it takes the ID and the name puts it in a text field in the folder.
The table is generated dynamically by a script
$('#tbl').append("<tr class=\"corpoTbl\"> <td class=\"ids\">" + item.ID +
"</td><td class=\"nome\"><a href=\"#\" onclick=\"Seleciona()\">" + item.Nome + "<\a></td></tr>")
I’m trying to get the text of the link like this:
function Seleciona(event) {
var id = event.ID
var nome = event.Nome
$('#ID').val(ID);
$('#nome').val(nome);
$(this).dialog("close");
}
That code is in need of some corrections. When you do the
append
you have bad tags, you’re not sending anything to the functionSeleciona
– CesarMiguel
what I should pass to the Select function?
– Alan Almeida
I have already made an answer with the necessary editions
– CesarMiguel