function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
WPCMSWPCMS 

Prevent User from Entering a Double Space

How do you prevent a user from entering a double spaces in a text field?

 

We have a field that must be unique but users are getting around the issue by adding double spaces.

 

What would the validation be to prevent them from saving it?

 

Thank you in advance

Best Answer chosen by Admin (Salesforce Developers) 
SporterSporter

Try the following and let me know how it goes:

 

 

IF( FIND(" ", Name ) = 0, false, true)

 

Name is just Account Name field in this example but any text field should work.

 

All Answers

SporterSporter

Try the following and let me know how it goes:

 

 

IF( FIND(" ", Name ) = 0, false, true)

 

Name is just Account Name field in this example but any text field should work.

 

This was selected as the best answer
WPCMSWPCMS

That works. Thank you.