Skip to content

validate apply to all fields, but only if there are 2 code fields #65

Description

@BryceStevenWilley

Ran into this while trying to refactor EFSPIntegration / MAPetitionToSealEviction stuff, so all e-filing interviews can login without a separate tab.

Code to reproduce below: all 3 fields on the screen will require their inputs to match the validation for the first field.

imports:
  - re
---
event: done
question: idk
---
mandatory: True
code: |
  new_password
  done
---
question: |
  Create an account
fields:
  - Password: new_password
    under text: |
      Password must be at least 6 characters with a least one letter and one number or symbol.
    validate: |
      lambda p: re.match("^.*(?=.{6,})(?=.*[a-zA-Z])(?=.*[\\d\\W]).*$", p)
  - code: |
      [{ "label": "ignore the rule above", "field": "random_text"}]
  - code: |
      [{ "label": "type anything", "field": "random_text2"}]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions