I use a dropdown list to get into all movie titles of a movie database and an “onchage” function trying to filter them by user’s keystroke. It works but what I need too and I don’t know how to do this is to pass the href link for every selected title into the list
Does it possible?
the code is
<script>
function myFunction(val){
alert(val);
}
</script>
<?php
require_once('Connections/greek.php');
mysqli_select_db($greek, $database_greek);
$query_lresult = "SELECT * FROM MainSearch order by Titles ASC ";
$lresult = mysqli_query($greek, $query_lresult) or die(mysqli_error($greek));
$row_lresult = mysqli_fetch_assoc($lresult);
$totalRows_lresult = mysqli_num_rows($lresult);
?>
<input type="text" list="titles" onchange="myFunction(this.value)" size="100"/>
<datalist id="titles"/>
<?php
do {
if ($totalRows_lresult > 0) {
?>
<option value="<?php echo $row_lresult['Title1']; ?> <?php echo $row_lresult['etos']; ?> <?php echo $row_lresult['kind_movie'];?>"> </option>
<?php }
}
while ($row_lresult = mysqli_fetch_assoc($lresult));;
?>
</datalist>
<?php
mysqli_free_result($lresult);
?>
and the href is something like
<a href="index.php/search-movies/titlededj?id_films=<?php echo $row
Many thank’s