Accept user input - only numbers

I have a situation where I want the user to enter only numbers in response to a READ command. I have some validation to restrict the number to be between 1 and 12, but if the user type in some characters the script echoes some error message and goes to the next command. Below is a snippet of the script. Thanks in advance for any help.

period=0
while [ $period -lt 1 ] || [ $period -gt 12 ]
do
echo Export Period?
read period
done

you can typeset your variable to an integer. Then after you read in user input, check $? for any errors. You will also want to redirect standard error to /dev/null to avoid the errors when the user attempts to type in a char when you only accept int

typeset -i period