Submit password to get data from .txt

Can somebody, please, tell me the script for this.

I have a text field for product code and a submit button.
When a certain code would be submitted, data from an external .txt file will be loaded into a number of other fields.

How to achieve that?

Thank you!