6

I am looking for an out-of-the-box solution (no code due to the lack of tools) for preventing the users from inputing list items with special characters. It would also be great if I could disallow names over a certain character length. Can somebody think of an easy solution to this problem?

1
  • Can you use InfoPath? You can use regular expressions with InfoPath. This link may help you.
    – newbie
    Commented Jul 4, 2017 at 6:11

3 Answers 3

11

Try this simple method using column validation.

On List Settings > Column > Column Validation, add this:

=AND(IF(ISERROR(FIND(",",
[ColumnName])),TRUE),IF(ISERROR(FIND("&",
[ColumnName])),TRUE),IF(ISERROR(FIND("!",
[ColumnName])),TRUE),IF(ISERROR(FIND("@",
[ColumnName])),TRUE),IF(ISERROR(FIND("~",
[ColumnName])),TRUE),IF(ISERROR(FIND("#",
[ColumnName])),TRUE),IF(ISERROR(FIND("$",
[ColumnName])),TRUE),IF(ISERROR(FIND("%",
[ColumnName])),TRUE),IF(ISERROR(FIND("*",
[ColumnName])),TRUE),IF(ISERROR(FIND("(",
[ColumnName])),TRUE),IF(ISERROR(FIND(")",
[ColumnName])),TRUE),IF(ISERROR(FIND("-",
[ColumnName])),TRUE),IF(ISERROR(FIND("+",
[ColumnName])),TRUE),IF(ISERROR(FIND(":",
[ColumnName])),TRUE),IF(ISERROR(FIND(";",
[ColumnName])),TRUE),IF(ISERROR(FIND("[",
[ColumnName])),TRUE),IF(ISERROR(FIND("]",
[ColumnName])),TRUE),IF(ISERROR(FIND(".",
[ColumnName])),TRUE),IF(ISERROR(FIND("/",
[ColumnName])),TRUE),IF(ISERROR(FIND("\",
[ColumnName])),TRUE))

Source: How to validate the special character on SharePoint List Column

1
0

For those who's wondering how to include also apostrophes " and ' (or any other characters) in column validation just use CHAR(34) and CHAR(39) inside the FIND formula.

...FIND(CHAR(34),[ColumnName])...

0

Please note there is a maximum of 20 items you can include in the above validation, which will NOT cover all the special characters.

But in windows certain ones cause problems for sure like /\<>|*:;"'?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.