Masked input value is sent to server unmasked
Masked input value is sent to server unmasked
Title pretty much sums up the issue.
Let's say i have a field in the editor:
{
label: 'cargoWeight',
name: 'cargoWeight',
type: 'mask',
mask: '0999999.9999',
}
After i enter 10.10 in the field and send the data, 10.10 is sent as 1010 - without the dot.
How do i fix that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I do not care much for the behavior of mask so I created my own plug-in to deal with numbers.
here is a rough draft of it https://github.com/bindrid/DataTable-Plug-ins/blob/master/Editor%20Numeric%20Field
@Bindrid2 , hey, that's pretty good.
I'll just disallow commas, just this once.
Thanks!
Yeah - that's superb. Nice one!
Allan
Is there any way to get the masked value with the editor.maks.js ?
thanks!
Yes it appears it is possible from their documentation.
So in Editor you could do:
To be honest I don't understand why you would need to pass something into
masked()
since I would have thought it would just read from the input element, but that would be a question for the Masked input folks.Allan