Use "telephone" input type, presenting a number-only input on the iPhone at least, and also still making the input a "string", allowing all the checking to still work.