Having problem with automatically populate look up text field

Having problem with automatically populate look up text field

I have been looking and looking through these forums for an answer on this but so far have not found anything that will work.  I want to be able to make a selection from a dropdown and have it fill in the text field below it automatically with the value pulled from that record.
I have one form called Class_List which holds a bunch of classes and their prices.  The class name field is 'Class' and the price field is 'Price'.  I have Student_Registration_Form where students can sign up for a class.  They select a program.  When they select their program, it changes the class list for the dropdown below (field 'Class') (that works fine).  Then when they choose their class, I want the price field below to automatically populate with the correct price from Class_List. 
Based on another post I read, here is what I have so far:

in "On User Input" I have: 


if (input.Class != "" ) 
{ myClass  =  Class_List[Name == input.Class];
input.Price = myClass.Price;


}

When I save the script I get the following error:
Error at line:0
Form Class_List does not exist in this application




How do I get a lookup text field to populate automatically?

Thanks