K
K
krka922020-08-31 12:49:53
React
krka92, 2020-08-31 12:49:53

How to get the raw value of a textbox with a mask?

CodeSandBox

I need to enter SNILS by mask. When sending to the server, I do not need a mask. Is there a way to get the value without a mask?
That is, 123-456-789 01 is displayed in the field, the same is displayed in the state. And you need to get the value 12345678901.
Or will you have to manually remove the mask from the value?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McBernar, 2020-08-31
@McBernar

Well, just remove all '—' from the text before sending the data.
str.replace('—', '')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question