Auto add of next form elements

hello everyone,
i am new to this web field, please help me for the following query if anyone knws about it.
here the query, " i am tranfering water from one tank to many tanks. but the condition is there are 5 systems are available. each system having some number of tanks. the tanks are maintained by ‘Tank Number’ which is unique in the whole environment.
initially i wil pick system. using ajax function i wil auto populate tank number which residing at particular selected system. after selecting tank number i wil generate tank parameter to be filled like initial level, final level, total quantity, etc through ajax. the tank parameter are in both source and destination side. but these parameter varies by number. like source tank have ‘purity of water’, etc which is not present in destination tank.
now the problem arises when transferring water from one tank to many tanks. because at source tank values to be entered only once. and at destination side the person wil fill 1st tank. and based on the situation he will decide to fill next tank.
if i keep ‘Add Tank’ button at the end the new tank entries should appear at the end.
can anyone know about this please post messege to me. i will be very thankful. one thing that i know is, this problem has to solved by using javascript.