March 14th, 2013, 09:12 AM
Cftext box accept only multiple on 0.25 values.
i got a problem.i have a cftext box.
it should accept 0.25 multiples means 0.25,0.50,0.75,1.00,1.25,1.50 like that.
<cfinput type="text" name="abc" id="abc">
i have got requirement like this.
15 Minutes - 0.25
30 Minutes - 0.50
45 Minutes - 0.75
60 Minutes - 1.00
75 Minutes - 1.25 and so on...
can any one help me on this
March 14th, 2013, 09:23 AM
March 14th, 2013, 09:40 AM
range is not mention user can enter any no multiple of 0.25.
my form is submitting <cfform > so i have to do in CF side..
please help me if you have soluton
March 14th, 2013, 11:27 AM
Take the string, split it into two values with "." as the delimiter, and check that the second part of the string is 00, 25, 50, or 75.
March 14th, 2013, 06:55 PM
Either that or verify the second part is numeric. Then use MOD 25. If it equals 0, the value is a multiple of 0.25.
That said, if the value can only be a multiple of 0.25 a set of select lists (hours and minutes) might work better for the front end. You should still validate on the back end, but lists might be more intuitive for the front end.