Hi I have a quick question to ask..
But ill make an example first
Column1 is MemberID
Column2 is Teamname
MemberID = 23, Teamname = ggdiablo
I have made a dropdown list of my teamname column..
<select id="teamlist" name="teamlist">
$stmt = $pdo->prepare('Select MemberID, teamname from members where ');
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<option>".$row['teamname']."</option>";
}
?>
</select>
is it possible to automatically fill in MemberID in a textbox form if I choose “ggdiablo” from the dropdown list?
if so, how?
Use javascript. Add a value attribute for each tag, with the MemberID. Add a onchange attribute to the tag, with the following value:
onChangeTeamListSelect();. Fix your code, you are missing an opening tag.