Limiting options in number field

Limiting options in number field

I have a number field, and want to use it in a calculation. Is there a way of scripting to limit the input to 1-5?