Basically, I have following problem:

I have a HTML Form with a textfield which has multiple spaces behind each other, yet when submitting the form, they are reduced to one space.

In the textfield, it would have this format:

```
.--  .-

```

But when reading it in, it has this format:

```
.-- .-

```

My problem is that when submitting the TextField, it matters whether there are one, two, three, or however many spaces behind each other.

How can I stop the TextField from automatically reducing the spaces to one?

I am using it in a JSP project, but I don't think that matters. Any help would be greatly appreaciated.

EDIT:
I found [this related Question](https://stackoverflow.com/questions/37706079/prevent-html-removing-successive-spaces), however it has no accepted answer and the only answer given does not work for me.