1
I want to get the value of div
when I click. The problem is that it creates a div
in the foreach
. I want to get the id
, to then pass this value to another page and use to make a SELECT in the Sqlite database.
$array_resultadoss = array(); //array
$array_resultadoss=select($dir, $base, $i);
$titless = ""; //variable inicialize
foreach($array_resultadoss as $key =>$value){
$titless .= "<div class=dois>".$value['id']."</div>";//save in variable value
}
echo"
<td class='td_today'>
<div class=divday style='cursor:pointer' onclick='popup(\"_popup_cal.php?jour=$i&moisEcris=$months[$moisaff]&annee=$year&mois=$month&txttitle=$txttitle&txtstart=$txtstart&txtend=$txtend&txtdescription=$txtdescription&maj=$maj&clean=1&numevent=$numevent\",400,300)';>
".$titless."</div>
</td>";
}
How are you trying to regain value in
_popup_cal.php
?– Marcio Mazzucato
By the GET method
– akm
By the GET method you have to pass the variable on the link.
– Jorge B.
Right and pass here onclick='popup("_popup_cal.php? id=$key&jour=$i&moisEcris=$months[$moisaff]&annee=$year&mois=$month&txttitle=$txttitle&txtstart=$txtstart&txtend=$txtend&txtdescription=$txtdescription&maj=$maj&clean=1&numevent=$numevent",400,300)'
– akm
Where I can’t see
$array_resultadoss
nor$key
nor$value
...– Jorge B.
Not id=$key? So how should I do?
– akm
Let me get this straight you want every element of
$array_resultadoss
have a<td class='td_today'>
?– Jorge B.
I have only this div that shows all the events of the database. I want to click on the div, give me the id (value) in the record that I clicked.
– akm