Auto Populate without Submit

Auto Populate without Submit

Is it possible to auto populate fields from a lookup field without hitting submit? 

I am working with two modules: leads & contacts

Leads module
I have a contact lookup field called 'Existing Client' and I have contact information fields.
If Existing Client is not null I would like it to auto-populate the client fields upon user input, since some of the fields are mandatory. 

I created a script (which I have not tested yet) to map the appropriate fields. 
  1. // get record
  2. lead = zoho.crm.getRecordById("Leads",leadid);
  3. //lookup the value in 'Existing_Client' lookup field
  4. clientLookup = lead.get("Existing_Client");
  5. if(clientLookup != null)
  6. {
  7. // get contact record id
  8. contactid = clientLookup.get("id");
  9. // get contact record
  10. contact = zoho.crm.getRecordById("Contacts",contactid);
  11. // get contact information
  12. firstname = contact.get("First_Name");
  13. lastname = contact.get("Last_Name");
  14. email = contact.get("Email");
  15. phone = contact.get("Phone");
  16. //create map
  17. mp = Map();
  18. mp.put("First_Name",firstname);
  19. mp.put("Last_Name",lastname);
  20. mp.put("Email",email);
  21. mp.put("Phone",phone);
  22. // auto populate lead fields
  23. updateRec = zoho.crm.updateRecord("Leads",leadid,mp);
  24. }

My problem? I cannot figure out how to populate on user input, only on submit/save.