Custom Script to populate item_name based on item_code

I was looking for some custom script that can populate the item_name same as the item_code. Maybe either onblur or onchange effect I want this to script to trigger. I tried looking at the forum for some inspirations but to no avail.

Any kind of help/suggestions/point of starting will be great.

I want this happen both on the quick entry window as well as the full screen one so I believe my Doctype will be Item, right?

I am not understanding your requirement. Where do you want to populate item name and onchange of what you wish to populate it?

While adding a new item, on fill up of item_code, the item_name field automatically gets populated with the same data as item_code.

Okay, so I have tried this script

frappe.ui.form.on(“Item”, “item_code”, function(frm) {
var copy = crm_frm.item_code;
cur_frm.set_value(“item_name”, copy);
});