I need to invoke a function on click of a link in a table and pass a variable to make a new query to the database.
In practice, I show a table of data in a table of my db. I want to view them in a new page (but only the row selected by me).
How can I send to the server (using jquery) the ID that is in the anchor element id attribute when it is clicked?
ITALIAN VERSION
Io necessito di richiamare una funzione sull' onclick di un link presente in una tabella e passargli un variabile per effettuare una nuova interrogazione al db.
come posso fare?
In pratica, mostro in una tabella dei dati di una tabella del db. e poi voglio visionarli in una nuova pagina (ma solo la riga scelta da me)
come posso fare per inviare al mio javascript (uso jquery) il valore id selezionato
Here's my code:
<?phpprint("
codice to make a table
<... < td>< a id=rich".$idrichiesta." href=\"#\" onclick=vediticket(".$idrichiesta.")> vedi link < ./a>
...
efunction vediticket(ID){ $.ajax({ type: "POST", url: "inc.miapagina.inc.php", data: "idric="+ID, success:function(msg){ ("#mydiv").html(msg); } }); }`e