Is there a way to trigger change in dialog box fields?

Is there a way to trigger change in dialog box fields? Like what doctype fields do.

you can achieve this with - onchange event.

e.g.

var dialog = new frappe.ui.Dialog({
	title: __("Customer Details"),
	fields: [{
		fieldtype: "Link",
		fieldname: "customer",
		label: __("Customer"),
		options: "Customer",
		reqd: 1,
		onchange: function(e) {
			console.log("Selected Customer: ", this.value)
		}
	}]
})
dialog.show()
3 Likes

cool! Thanks let me try