• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
validation callback

#1
[eluser]quasiperfect[/eluser]
hi

i have two fields and i need to output a error based on the fields data.
something like the passwords that have to be equal but i don't need them to be eaqual but respect a custom relation.
how can i resolve this using a callback function ? i need to call callback_myfunc($param1,param2) to be able to compare the two values. or any other method to do this ?

thanks in advance for any response

#2
[eluser]Pascal Kriete[/eluser]
Put the callback rule on the second field. The parameter to the callback function will be the content of that field. The other one you get using $this->input->post('fieldname');

Does that help?

#3
[eluser]quasiperfect[/eluser]
yea i did like u said but would had been nice to have a special function for something like this.
like if is used the same function in 3 rules the function to get the 3 values and so on

#4
[eluser]Derek Allard[/eluser]
http://ellislab.com/forums/viewthread/79571/#399414

James Gifford proposes a very elegant solution.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.