Use AJAX/HTTP request to validate your form or specific fields, and use the HTTP-response for rules or feedback messages. The setup for this is very easy. In this example we added url https://my-api-url/api.php which contains the businesslogic for validation.
We added 2 parameters, 1 static parameter: fixed-value. And 1 dynamic parameter based on user input.
The API shoud return in JSON format like this:
result (required) should be OK or NOK or INIT for validated, not validated and undecided (mostly used for initial state).
success (required) should be true if the request was successful or false if there was an error
message (optional) is used to show a custom validation message if the validation failed. This wil override the message you entered in the Peggy Forms editor.
You can provide extra properties which you can use in other form fields, for example to show extra information in a text block:
And/or you can use these properties in the logic/rules to, for example, show a field only when the hasProp property equals true:
If you still need help, view this quick video tutorial.
See an example here.
Read more about using webservices in your form