1
0
-1

Is there any way to use javascript to see if a field is currently visible on the form in Maestro?

 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      You can use:

      var item = Form.items["canISeeThis"],
        isVisible = Rules["sh_" + item.id](data, item);

       

      We will make a more convenient helper method for this.

      1. Tim Stewart

        OK I've added a convenience method for this, which also goes through and checks visibility on all ancestors too. It is: Form.isVisible(itemOrId, data) And will be available as of Maestro 5.0.18.

      2. Chris Reid

        How do we call this rule Tim? What do we pass for itemOrId? Is this just a reference to the form object, the same way we'd reference the value? And do we just pass the 'data' object as the second parameter? I'm currently calling this using: Form.isVisible(data.textField, data) I get an error in the console: Cannot read property '$$parent' of undefined

      CommentAdd your comment...