quadrant6
02-27-2007, 04:11 AM
I have a form where users enter weight, it should be in the one of the following formats:
72
152.12
65.5
65.55
120
My validation eregi is as follows but doesn't seem to work:
if(eregi("[0-9]{1,3}[\.]{0,1}[0-9]{0,2}", $weight))
That should equate to (1-3 numbers, followed by an optional ., followed by an optional 1-2 numbers)
Am I missing something?
72
152.12
65.5
65.55
120
My validation eregi is as follows but doesn't seem to work:
if(eregi("[0-9]{1,3}[\.]{0,1}[0-9]{0,2}", $weight))
That should equate to (1-3 numbers, followed by an optional ., followed by an optional 1-2 numbers)
Am I missing something?