Load data in one field based on the data in previous field – Node edit form

I have two already created fields in my custom content type Product.

  1. Category – Term_reference field (with widget type as Term Reference Tree).
  2. Name -Textfield.

All I want to do is, when creating/editing a content type product whichever category the user selects from Category field, the Name Textfield should be updated automatically (on Ajax request) and then the user can save the node.

Thanks in advance.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed