How to correct the operation of the up/down arrows when entering a number with 2 decimal places.
How to correct the operation of the up/down arrows when entering a number with 2 decimal places.
Link to test case: http://live.datatables.net/gasituho/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Problem 1:
When using the up/down arrows with increment of "1.00", it does not put the decimal place "x,00". How can I add the leading zeros during each increment. Example:
0.00
1.00
2.00
3.00
Problem 2:
When I use the property
attr: {
type: "number",
}
By entering the digits manually without using the up/down arrow, it also allows you to enter text manually.
As I block the text entry and only allow numbers from 0-9.
Answers
Reading the HTML specification I don't think it is possible with just attributes. You'd need to use a little Javascript such as:
http://live.datatables.net/yojipoju/1/edit
Use a
keypress
event listener to disallow non-numeric (or decimal place) input.Regards,
Allan