Skip to content

How to automatically insert commas into text entry box #3374

Answered by becky-gilbert
noa-no-h asked this question in Q&A
Discussion options

You must be logged in to vote

Great question @noa-no-h, and sorry that this isn't clear from the survey plugin docs/examples.

Josh is right that you can use the SurveyJS masked input to do this. Using maskType: "numeric" automatically gives you the commas for the thousands separator. And adding "precision": 0 in the maskSettings prevents people from entering decimals. See here for more info and examples for the masked input: https://surveyjs.io/form-library/examples/masked-input-fields/documentation.

The reason why Josh's suggestion isn't working is that you have to remove the inputType: "number" parameter because that is what is producing the weird behavior you're seeing (it causes an error in the SurveyJS core packa…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@jodeleeuw
Comment options

@becky-gilbert
Comment options

Answer selected by noa-no-h
@becky-gilbert
Comment options

@noa-no-h
Comment options

@becky-gilbert
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants