I need to make a text field accept only numbers and decimal point, and default to two decimal places. I got this code from a search here. It works for accepting only numbers. I need to make it accept decimal point, and default to two decimal places.
<input type="text" onkeypress="return event.charCode === 0 || /\d/.test(String.fromCharCode(event.charCode));" />
Thanks