I would like to allow user to perform simple calculations in the text inputs, so that typing 2*5 will result in 10. I\'m replacing everything but digits with an empty string
this is safe because you are doing input validation before you put it into eval.
besides you should also add:
()%