[eluser]codex[/eluser]
[quote author="Khoa" date="1219060156"]Hi codex, this is exactly what I'm looking for. But can you just upload the lib as a whole so that people can download, and can you also give an example of how it can be used? :-P Sorry that I'm a bit lazy, just want the quickest way to make the thing work. Thanks.[/quote]
If you want I can send you the class. Haven't looked into uploading yet, so I don't yet know how that works.
How the class works is no different from the normal way. You set the rules exactly like so
Code:
$rules['password'] = “trim|password|xss_clean|required|matches[passwordconfirm]
If there's a custom rule for this field the custom error will be shown, otherwise the default will be shown.
Code:
$lang['default']['required'] = “You must enter a something”;
$lang['password']['required'] = “You must enter a password”;
$lang['password']['matches_custom'] = “Your passwords do not match”;