How can I make a button populate a field of a form on the same page?

I have a website which offers repairs for 3 products.

I have a row of images of each one and a button for each one of them.

I also have a form at the bottom of the page that asks them for the personal info and the product that needs repaired.

I want to make the buttons from the images auto-complete the field where it asks what product needs repaired and scroll to the form that is at the bottom of the page.

I think I need a javascript function but I don’t know what to include in it.

I suppose I need a ‘value’ attribute and an id to the form field.