Welcome Guest, Not a member yet? Register   Sign In
Custom validation rules?
#7

[eluser]RyanH[/eluser]
[quote author="mironcho" date="1200805002"]Hi RyanH,
If you don't prefer creating new class, you might create callback function in your controller - simply put xwero's domain_email function in your controller and use it in your rules in this manner:

Code:
$rules['email'] = 'valid_email|callback_domain_email[gmail.com]';
[/quote]Thanks, I think this will work much easier for me.

Also, how do I go about creating a validation rule that allows spaces? I want to allow only alpha numeric, or just numeric, but also contain spaces. For example, a state name may have two words such as New York, but when you use the alpha or alpha_numeric rule, that returns false.


Messages In This Thread
Custom validation rules? - by El Forum - 01-19-2008, 02:37 PM
Custom validation rules? - by El Forum - 01-19-2008, 02:49 PM
Custom validation rules? - by El Forum - 01-19-2008, 03:01 PM
Custom validation rules? - by El Forum - 01-19-2008, 03:16 PM
Custom validation rules? - by El Forum - 01-19-2008, 03:31 PM
Custom validation rules? - by El Forum - 01-19-2008, 04:56 PM
Custom validation rules? - by El Forum - 01-19-2008, 05:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB