Welcome Guest, Not a member yet? Register   Sign In
custom form validation
#4

[eluser]CroNiX[/eluser]
The first parameter of a callback function is the value of the field that was submitted. If the form fieldname was "First Name" and they submitted the form after entering "chris" in the first name field, then $fieldvalue would be "chris". It's the thing your validation rule is validating against.

The second, optional, parameter is to pass extra data/parameters to your validation function. To pass it from the rules definition, you just place whatever value you are placing in the square brackets, just like in my example.

It should be self explanatory if you study the code I posted.


Messages In This Thread
custom form validation - by El Forum - 07-11-2012, 09:08 AM
custom form validation - by El Forum - 07-11-2012, 10:01 AM
custom form validation - by El Forum - 07-12-2012, 08:02 AM
custom form validation - by El Forum - 07-12-2012, 09:30 AM
custom form validation - by El Forum - 07-12-2012, 11:16 AM
custom form validation - by El Forum - 07-12-2012, 11:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB