Can frappe.ui.form.on work with web forms

frappe.ui.form.on I want to use its function with web form but it does not work as asks for a doctype

Use frappe.web_form.on()

If it doesn’t work on the js file, try in the Client Script in the webform setup

Yes it worked that way