验证唯一的电子邮件ID

I have created three email textfield in joget. I want the emails to be unique for every email field.enter image description here

屏幕快捷方式已附加。如果其中任何一个的电子邮件ID都相同,我想显示错误!

我怎样才能做到这一点?

`import java.util.Arrays;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.form.model.Element;
import org.joget.apps.form.model.Form;
import org.joget.apps.form.model.FormData;
import org.joget.apps.form.service.FormUtil;

public boolean validate(Element element, FormData formData, String[] values) {
    boolean result = true;

    //get field 1 value from form data object
    String field1Id = "field1";
    Form form = FormUtil.findRootForm(element);
    Element field1 = FormUtil.findElement(field1Id, form, formData);

    if (field1 != null) {
        //get value of field 1
        String[] compareValues = FormUtil.getElementPropertyValues(field1, formData);

        //compare the value of field 2 and field 1 are equals
        if (!Arrays.equals(values, compareValues)) {
            String id = FormUtil.getElementParameterName(element);
            formData.addFormError(id, "Value not equal!!!!");
            result = false;
        }
    } else {
        //ignore if the field 1 not exist
    }

    return result;
}

//call validate method with injected variable
return validate(element, formData, values);`

我已经编写了这段代码,但是没有成功。如果您可以通过J查询代码/ JS代码为我提供帮助,我真的会为我提供帮助。 AS joget支持它