if the variable is f, and the minimum and maximum you want is fmin, fmax
You can add the following to the [b]action[/b] field for the numerical input textfield element

if(f<fmin)f=fmin;
else if(f>fmax)f=fmax;

Is that the logic you want. Just try to express your login into formula/equation.