Welcome Guest, Not a member yet? Register   Sign In
Get current input field data in callback function
#1

[eluser]JavaJunky[/eluser]
Is there a way inside a validation callback function to get the data related to the field currently being validated?

I'm trying to write one function that I can use to validate multiple fields, but I want to be able to know which field I'm validating in the callback function.

I want to do something like this:

Code:
function my_value_check($str) {
   $this_field = ??? // THE CURRENT FIELD BEING VALIDATED (can be field label)
   switch($this_field) {
      case "first_name":
         // checks $str against data for "first_name"
      ...
   }
   // return true or false
}


Messages In This Thread
Get current input field data in callback function - by El Forum - 03-01-2010, 04:51 PM
Get current input field data in callback function - by El Forum - 03-01-2010, 11:38 PM
Get current input field data in callback function - by El Forum - 03-02-2010, 01:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB