So basically you want to insert a space after each 3 characters?
You may also need to control the input keystrokes.
For the custom format,
util.printx("99 999 999", event.value);
Here's an easy way to do it:
Go to the properties of your Field
Go to the Format tab
under the Select format category drop down select Special
under the Special Options pane select Arbitary Mask
a blank field will appear below the Special Options Pane enter 999 999 999
if you want user input for numbers use 9 if you want them to be able to use letters as well use X
A12 345 678
X99 999 999
If you want hyphens between the numbers or any other character use
users the "-" will automatically appear as users type.
Hope this helps