How to execute my Javascript code in project

I want to make a counting number of years in Frappe. Now I try to understood How i need to point the path in python
my javascript file:
frappe.ui.form.on(“Lead”,“date_of_birth_add”,function (frm) {
alert(‘fsda’);
frm.set_value(‘age’,
});
my hooks.py:
doctype_js = {
“Quotation” : [“erpnext_safer/erpnext_safer/custom_scripts/date_validation.js”],
“Lead”: [“erpnext_safer/erpnext_safer/custom_scripts/years_counter.js”]
}

It looks like date_of_birth is a Date field.

Use date_of_birth, instead of date_of_birth_add

1 Like