Validate a Single line of text column type of list

2019-05-17 12:35发布

How to validate a Single line of text column type of list in sharepoint 2010 to enter accept only numbers?

Please don't tell me to use calculated column , I tried it and it didn't work for me as i want.

Please advice, thanks in advance.

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-05-17 12:44

I went through the available functions and I don't see one that will validate whether a text value is a number.

BTW, is there a reason you are not using a Number field instead of a Single line of text?

查看更多
\"骚年 ilove
3楼-- · 2019-05-17 12:49

This should work:

=ISNUMBER([MyColumn]+0)
查看更多
Bombasti
4楼-- · 2019-05-17 13:09

Here is what seems to work for me (building on @Rob_Windsor; newlines added for readability):

=AND(
  ISNUMBER(Number+0),
  ISERR(FIND(".",Number)),
  ISERR(FIND(",",Number)),
  ISERR(FIND("$",Number)),
  ISERR(FIND("+",Number)),
  ISERR(FIND("-",Number)),
  ISERR(FIND(" ",Number))
)
查看更多
登录 后发表回答