1
0
-1

i want to get value from filed id on my form

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi,

      I suppose this is helpful to achieve you requirement?
      Bean Shell Programming Guide#UseasFormOptionsBinder

      You can implement Bean Shell in your Form to get value from your filled Id.
      Sample Expected Result : Form should be able to Load time zone as the select box options.

      Hope it helps!
      Thanks

        CommentAdd your comment...
      1.  
        1
        0
        -1

        You can refer to Bean Shell Programming Guide#UseasFormValidator

        Maybe you can get an idea from something like: 

        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[] fieldValue = FormUtil.getElementPropertyValues(field1, formData);
                }
            } else {
                //ignore if the field 1 not exist
            }
         
            return result;
        }
        


          CommentAdd your comment...