This JavaScript shows how to update a text component of a form on a selection change in the same form. It uses the event onchange to trigger the javascript function to go see what is selected and look up the price for that selection. Its design allows the programmer to write the code for the selection order or the definition of the prices in any order he/she wishes.