can somebody send me a link for a tutorial for filling form options from a database after the user selects a choice.

for example, in one of the form inputs, the customer can pick from 4 vendors. if he picks the vendor A, the next input gets filled from a database that has certain products for vendor A. if the customer picks vendor B, the next input gets filled from the same database with certain products for vendor B. and the same for the next vendor.

i found a tutorial for making the selection and sending an output based on that selection, but not filling the options in the next input.