How to set lenght in the small text field type

Hello,
is there any option to set the words limit/length in the small text field type.

@falah123 Try this.

frappe.ui.form.on('DOCTYPE', {
    FIELD: function(frm) {
        if (frm.doc.FIELD && frm.doc.FIELD.length > 10) {
            frm.set_value('FIELD', frm.doc.FIELD.substring(0, 10));
            frappe.throw(__('The text is too long. The maximum length is 10 characters.'));

        }
    }
});