Issue
LS,
I have created a array from a MYSQL table like this:
$sqlNF="SELECT FROM FEIHorse GROUP BY nf ";
$result=mysqli_query($dblink,$sqlNF);
$rawdata = array();
$i=0;
while($row = $result->fetch_assoc()){
$rawdata[] = $row;
$i++;
}
The question is how to connect this array to an HTML input element to be used as a datalist
Solution
You can do like this:
<form action="/action_page.php" method="get">
<input list="browsers" name="browser">
<datalist id="browsers">
<?php
foreach ($rawdata as $option) {
echo '<option value=\''.$option.'\'>';
}
?>
</datalist>
<input type="submit">
</form>
Answered By - Maris
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.