[eluser]marjune[/eluser]
eh, pipz my problem is in my jquery script, when i click the thing i cant get the exact value of the id from the database because only the id of the first record would apear
here my code in a loop
foreach($data as $data) {
<input type="hidden" id="hideid" value="<?php echo $data->id;?>">
<a class="topicans"><?php echo $data->topic."</a>";?>
}
and my jq script
$(function(){
$(".topicans").click(function(e){
e.preventDefault();
var topic_id = $('#hidden').val();
alert(topic_id);
});
});
or
$(function(){
$(".topicans").click(function(e){
e.preventDefault();
var topic_id = $('#hidden',this).val();
alert(topic_id);
});
});