Custom doctype can not open (Error)

Guys my custom doctype can not open.
The error is here:

Unable to handle success response  desk.min.js:1509:4
console.trace():  desk.min.js:1510
	frappe.request.call/< http://localhost:8001/assets/js/desk.min.js:1510:4
	i http://localhost:8001/assets/frappe/js/lib/jquery/jquery.min.js:2:27146
	fireWith http://localhost:8001/assets/frappe/js/lib/jquery/jquery.min.js:2:27914
	z http://localhost:8001/assets/frappe/js/lib/jquery/jquery.min.js:4:12057
	c/< http://localhost:8001/assets/frappe/js/lib/jquery/jquery.min.js:4:15619

Does anyone know why it become like this? and how to fix it.
I already delete all code that i create. But it still become like this.

Seems code has not removed properly, did you reload the system after removed the code?
If possible can you share the code?

The Doctype I was deleted. The folder and table on mysql also i deleted. Then i create same doctype. I have a new problem, the doctype does not show up. I search on global search, does not show up.

Why is this happen?

Okay it’s already fixed.

But i have some question here,
what is different between trigger validate and “validate”?

here the example code:

frappe.ui.form.on("Employee Receipt", "validate", function(frm) {
}

vs

frappe.ui.form.on("Employee Receipt", {
    validate: function(frm) {
    }
}

functionality wise Both are same

frappe.ui.form.on("Employee Receipt", {
    validate: function(frm) {
    }
}

In above code you can add multiple trigger like refresh, setup

frappe.ui.form.on("Employee Receipt", {
    validate: function(frm) {
    },

    refresh: function(frm) {
    }
}

Ohh I see. But when I put this code into my .js file,

frappe.ui.form.on("Employee Receipt", {
    validate: function(frm) {
        frm.set_value("balance_need_to_pay", (frm.doc.total_need_to_pay - frm.doc.payment));
        frm.refresh_field("balance_need_to_pay");

        if (frm.doc.status == "Outstanding") {
		if (frm.doc.total_need_to_pay <= frm.doc.payment) {
		        msgprint("total need to pay must more than payment");
			}
		}

	if (frm.doc.date < get_today()) {
        	msgprint("You can not select past date in From Date");
        	validate = false;
    	}
    }
}

The doctype become like this,

What is wrong with my code?