automatically filling form fields based on user selection
I am relatively new to Cold Fusion and would appreciate some help in formulating code to do the following.
I am trying to create an action page that will allow users to select a "year" with a set of corresponding subjects and subject codes. The idea is that after the user has selected their year (#Year#) on one part of the form, they are presented with a drop-down list of subject names that apply only to that year. The subject names, codes and offered years are stored in an Oracle table with the fields "title", "subject" and "year" (respectively). I want it so that the user need only select the "title" and then subject name and code will automatically enter on-screen table that will accept up to 12 entries. The names of the table fields are "SubjectName1" through to "SubjectName12" and "SubjectCode1" through to "SubjectCode12". I only want the year to be saved into the earlier mentioned Year field.
Further to this, I would like to find a way in which I can restrict the number of entries into these "SubjectName" and "SubjectCode" fields. On another section of the field, there is an option where the user chooses the "duration". Code for this is