Using js for Web Form

I’m working on the web form.
How do I use the boilerplate js files?
(appname/appname/appname/web_form/formname/formname.js).

In the browser console the js file is not loaded (Status 404).
Should I put the path in the hooks? What is the correct path to use?
Is the code inside the frappe.ready function or not?

I can’t get the code works. The same code in Client Script works but not in the files.

Thank you for any inputs.

Find out:

  • I can use the boilerplate doctypename.js file in the web_form directory.
  • put the code within the:
frappe.ready(function() {}
  • but can’t use the trigger, something like:
frappe.web_form.on('fieldname', () => {}

frappe.web_form.validate = () => {}
  • now the question is how to use the trigger needed?

Hi, Please were you able to solve this? if so what trigger did you use?

No I haven’t been able to solve it.
As I remember, I did it the other way… or I leave it… sorry I forgot.