Ignore white space when typing into an INPUT field

I have several INPUT fields where I want any white space to be ignored whilst typing.

Is there a way to use something like the INPUT Field’s Dynamic Attribute Key Up?

I just can’t work out what I should do, any idea?

Do you want to show a validation error message when a white space is entered?

It is not necessary.

So the answer is… it can have validation if it makes things easier, but is not necessary.

So you want to remove a white space or not add it when the space button is pressed?

not add white space when the space button is pressed … yes

Another thought just crossed my mind arising out of your question. If pasted, or drag and dropped, could any white space be removed in the process? Is this complicating matters?

You can try putting in a regex pattern in validation.
Refer some options here: https://stackoverflow.com/a/16334856/789264

On pasting or dragging text into the input, I am not sure what the parse text would be, but if it contains a space, it will throw a validation error.

If you are specifically looking to not allow the space key to work, you might have to look into a JS solution. Refer the solution here: https://stackoverflow.com/a/18780410/789264

Is there a Wappler way to do this?