aerni / statamic-livewire-forms

Supercharge your Statamic forms with Livewire
https://statamic.com/addons/aerni/livewire-forms
Other
28 stars 2 forks source link

Validation: Confirmed rule always validate to false #27

Closed FR6 closed 1 year ago

FR6 commented 1 year ago

When using the confirmed rule, the validation always return false.

A work around is to use the same rule and by adding data. to the field name: same:data.<field name>

Using:

aerni commented 1 year ago

Can you please provide a simple form blueprint that reproduces this issue?

FR6 commented 1 year ago

Here is a blueprint for the confirmed rule:

sections:
  main:
    display: Main
    fields:
      -
        handle: pharmacien_declarant_email
        field:
          input_type: text
          antlers: false
          display: Courriel
          type: text
          icon: text
          listable: hidden
          instructions_position: above
          visibility: visible
          always_save: false
          validate:
            - required
            - email
          width: 50
          group: pharmacien_declarant_coordonnees
      -
        handle: pharmacien_declarant_email_confirmation
        field:
          input_type: text
          antlers: false
          display: 'Confirmer votre courriel'
          type: text
          icon: text
          listable: hidden
          instructions_position: above
          visibility: visible
          always_save: false
          validate:
            - required
            - 'confirmed'
          width: 50
          group: pharmacien_declarant_coordonnees
aerni commented 1 year ago

You have to add the confirmed rule to the pharmacien_declarant_email field. Not to the pharmacien_declarant_email_confirmation field. That's why it's not working.