gberde

Field validation - make sure at least one field is populated

0 votes

I have 5 text fields on my form. Is there a way to make sure the signer (recipient) enters value in at least one of the five textboxes before the signer signs and completes the form?


Reply to: Field validation - make sure at least one field is populated

0 votes

Hi gberde,

 

Thanks for your post! You can add conditional logic to your fields to achieve the goal. Below is a JSON example where if any of the text fields "6GZpLhdVsxk0", "OBTUlemw7VY8", "DjMy29Jb5eg2", "BcRM86gDgpoB", "TpdJR1F0NIs7" is not empty, signature "ScgWPYhzQxIV" will be enabled. Otherwise the signature is disabled.

  "conditions": [
    {
      "id": "6562339e-e0aa-47ec-a96f-82cdbbc8fe18",
      "condition": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['6GZpLhdVsxk0'].empty == false",
      "action": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['ScgWPYhzQxIV'].disabled = false;"
    },
    {
      "id": "c9463cf4-54b9-4fad-947c-0fc8ced4a9bf",
      "condition": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['OBTUlemw7VY8'].empty == false",
      "action": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['ScgWPYhzQxIV'].disabled = false;"
    },
    {
      "id": "5b1f7d53-548c-416d-8b75-0bb681c85f41",
      "condition": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['DjMy29Jb5eg2'].empty == false",
      "action": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['ScgWPYhzQxIV'].disabled = false;"
    },
    {
      "id": "b8cd4b6e-6690-4acb-8672-0bb27be4c7db",
      "condition": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['BcRM86gDgpoB'].empty == false",
      "action": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['ScgWPYhzQxIV'].disabled = false;"
    },
    {
      "id": "7727ff52-1fcb-49fe-8c4c-88b924f1aeb2",
      "condition": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['TpdJR1F0NIs7'].empty == false",
      "action": "document['627758e1affd5443f1bacf3b2907687277b1bdde1a8cc903'].field['ScgWPYhzQxIV'].disabled = false;"
    }
  ]

 

Let me know if this works for you.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Field validation - make sure at least one field is populated

0 votes

when we do this, does  signature "ScgWPYhzQxIV" remain disabled by default when the form is opened?


Reply to: Field validation - make sure at least one field is populated

0 votes

Hi gberde,

 

Yes, a condition automatically implies its opposite scenario that when none of these text fields are filled in, the signature will be disabled.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off