Hi
I’m trying to create a form which gathers multiple values from load of different fields on a form and then perform some validation before processing the form
The normal validation rules for checking the fields have text entered and of the right format are working fine.
However what I’m struggling with is having a #FUNCTION which can do some validation based on a combination of the entered fields.
I have setup a hidden field to pass the #FUNCTION validation but unfortunately it is only passing through the value of the one hidden field and I haven’t managed to work out how to access all the form field values entered
eg 3 of my fields are:
db_server
db_username
db_password
And I want the validation rule to double check that combination of the 3 fields allows a valid mysql connection.
Any ideas?
-
☆ A M B ☆
- 24,524 Posts
I would use a custom function-in-a-snippet using the eFormOnValidate event.
# &eFormOnValidate (optional)
Expects a function name. This function will be called directly after the form validation has taken place. You can use this event to add your own extra validation logic. The function should accommodate the following parameters
* &$fields - (as reference) an associative array of field and placeholder values.
* &$vMsg - (as reference) a numeric array of validation error messages.
* &$rMsg - (as Reference) a numeric array of missing required fields.