I have two tables owner and veh. In veh (vehicle) table I have a linked field (owner) with owner table id (ID_O). In my veh form (veh.php) I am displaying existing data in a table but I am not able to populate existing owner names in dropdown list from where I can change name of owner.
Java script code is required to populate names of owners against every record.
2
Answers
If you are a beginner you can follow this.
Sounds like you’re aiming to dynamically populate a dropdown in your veh.php form with owner names based on the linked field. You’ll need a little AJAX magic. Basically, when your veh form loads or when a certain action triggers it, make an AJAX call to a script that fetches the owner names from your database (based on ID_O). Then, use javascript to populate those names into your dropdown. Don’t forget to handle cases where the AJAX call fails or returns no data! Simple but effective, this approach will get those owner names into your dropdown.