I need to create a function to allow numbers dot and comma. So anyone corrects the following function
function on(evt) {
var theEvent = evt || window.event
No need for JavaScript:
Modern browsers will handle this perfectly.
If you want to specifically allow commas as thousand separators and a single decimal point, try this:
... pattern="\d{1,2}(,\d{3})*(\.\d+)?" ...
Note that I am firmly against blocking user input. They should be able to type what they want, and then told if they enter something invalid.