Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have single line of text field in a Sharepoint 2010 list. I need to validate the particular field. The user will enter the number by starting with I or F. How do I validate the field if the user does not enter the number starting with I or F?

For e.g., (the user will enter I1900 or F9999), but if the users enters without I or F(such as only number 9999) how do I validate this field?

share|improve this question

4 Answers 4

If you are allowed to use InfoPath, you can do that InfoPath form rules with adding new custom pattern like this:

I?F?\d\d\d\d
share|improve this answer

you can add a jQuery / JavaScript block on the new/ edit page where you can validate the field.

share|improve this answer

=OR(ISNUMBER(FIND("F";Title));ISNUMBER(FIND("I";Title))), Title - your field

share|improve this answer

When creating the column, expand the "Column Validation" section and you should see a text box where you can enter a formula.

To test if the first character of a column called "ToValidate" is I or F use:

=OR(LEFT(ToValidate,1)="I",LEFT(ToValidate,1)="F")

The syntax is basically Excel so you might want to test any other formulas in that first.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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