Its my first steps on HTML and PHP . Im trying to create a dropdown box populated by MYSQL database.
In my code i can see the options but i want to get selected item via submit button or ONCHANGE function but i dont know how to do that.
Tried to search google for 5 hours. Im just an idiot or blind but can you help me ?
Here is my code :
<form>
<select id="choosePatient" name="PatientBox">
<option value="" selected disabled hidden>Choose</option>
<?php foreach($users as $user): ?>
<option value="<?= $user['patient_id']; ?>">
<?= $user['name']; ?>
<?=
$user['surname']; ?>
</option>
<?php endforeach; ?>
</select>
</form>