CodeIgniter Forums
form validation rule question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: form validation rule question (/showthread.php?tid=19635)



form validation rule question - El Forum - 06-13-2009

[eluser]vps4[/eluser]
what different with

alpha_numeric
numeric
is_numeric
integer
is_natural
is_natural_no_zero

it seems they are same thing.

$lang['alpha_numeric'] = "The %s field may only contain alpha-numeric characters.";
$lang['numeric'] = "The %s field must contain only numbers.";
$lang['is_numeric'] = "The %s field must contain only numeric characters.";
$lang['integer'] = "The %s field must contain an integer.";
$lang['is_natural'] = "The %s field must contain only positive numbers.";
$lang['is_natural_no_zero'] = "The %s field must contain a number greater than zero.";


form validation rule question - El Forum - 06-13-2009

[eluser]TheFuzzy0ne[/eluser]
Code:
alpha_numeric      # letters and numbers
numeric            # numbers and characters to do with numbers (- and ., and perhaps +)?
is_numeric         # I think that's just synonym for the above, perhaps for the previous validation library? I don't know, but it's not in the reference. :)
integer            # numbers only (including - and perhaps +)?
is_natural         # 0 or more
is_natural_no_zero # 1 or more
Hope this helps.