Hello,
I’m experiencing a very similar issue to this post, except that my input field is of type text.
I have a form where the user can enter an integer value, such as 1000, which I format using toLocaleString('en-US') before submission.
- If I enter
333and submit, the value is correctly sent to the backend. - However, if I enter
3333, it gets reformatted to3,333on the frontend. When I submit the form this value isn’t sent to the backend, so I can’t access it in the form’scleanmethod.
I’m not sure whether this is a JavaScript issue or something related to how Django template language that handles form inputs.
As a workaround, I currently strip the commas before submission and re-apply them on page load for display purposes.
You can clone this repository to reproduce the issue.
Any insights or suggestions?