Auto fill form from contact to potential module.

Auto fill form from contact to potential module.

I have to auto populate data from contact module to potential module. I have a section in contact module which have some custom fields. I have to populated that value to potential module when i select contact from the potential module. By using custom function, it is possible but it is populate on save module. I want value auto populate to fields when I select any contact from potentials look up fields. Any help?