First thing I don't know your Product_Master Architecture.
Any how If you took all the vedorname in Product Master
First collect all the field data;
secondly collect the vender id as per vendor name you collected. and set into vendarname;
finally Inserted all the valued into Product Master.
if you want detail please send the forms and related code to firstname.lastname@example.org