I am able to get the value for class="search_result"
from
But I am unable to get the value from class="resultid"
form PHP/ HTML table using Jquery.
I need the record id as well in a var to select the correct record.
Your help will be appreciated. Thank you very much.
Re my classes
1.’search_result’ . This works fine.
2.’resultid’ this does not get the value.
while($row = mysqli_fetch_assoc($result)) {
echo"<form action='' method='POST'>";
echo"<tr>";
echo '<td id="idrow"'.$row['id'].'" class="**search_result**">'.$row['make'].'</td>';
echo "<td class='**resultid**'>" . $row['id']. "</td>";
echo"</tr>";
echo"</form>";
{
$('#live_search').keyup(function(){
var input = $(this).val();
var type = 'make'
if(input!=''){
$.ajax({
url:"searchProd.php",
method:'POST',
data:{input:input,type:type},
success:function(data){
$('#searchresult').html(data);
$(".search_result").unbind("click");
$("**.search_result**").bind("click",function(){
$("#live_search").val($(this).html());
$.post('setrecord.php', {recordid:recordid});
location.replace("view.php");
});
});
});
}
});