Auto populate price based on selected product


How can i auto populate the price of an item based on a chosen product and then auto calculate the price and quantity before hitting the ADD button.
I think it should be a javascript/ajax/jquery stuff but dont know how to go about it.

The Unit price should be auto populated based on valu from the database. The amount is the Unit Price times the Quantity of the Product Selected.


My Form


Do you know how to add a listener to a button click (make something happen in js when you click something in the html page)?

Do you know how to fetch attributes/values from the html in js?

Do you know how to write attributes/values to the html from js?

If so you should be all set, if not you know what to start working with ^^