How to prepopulate form field

Hello,

Imagine I have a form with a dropdown menu, when I move the dropdown menu, I would like to have the table linked to the dropdown menu data pre-populating his new form, any idea how to do this please?

Thank you,

Ben

Via custom JavaScript.