One method is to use the EDIT event in the on DIALOG to watch that editbox and whenever the most recent character is a space, it will automatically remove 1 character from the end of the box.

Of course, that doesn't help if someone moves the cursor to the middle and enters a space. In that case, using $remove to remove all spaces as mentioned is a good idea. If you don't want them to be seen in the editbox, then put that into the EDIT event of the on DIALOG so that it removes spaces right away.

Invision Support
#Invision on