Florin M.
Florin M.

Reputation: 2169

Validation field value format

I have a field on a form called "PartNumber". What I want to do is: the field value to respect some standard/validation:

digit,digit,digit,letter,digit,digit,digit,digit,digit

So, 3 digits 1 letter 5 digits. Also, I have a "Save" button. If the user enters, for example, 123F45156 and then Save => OK. But if the user enters 1565515156 then Save => a messagebox will appear.

I will appreciate your help! Thanks

Upvotes: 1

Views: 1089

Answers (4)

Leigh
Leigh

Reputation: 71

In the Input Validation formula enter:

@If( @Matches( @ThisValue; "{0-9}{0-9}{0-9}{A-Z}{0-9}{0-9}{0-9}{0-9}{0-9}" );
    @Success;
    @Failure("Please use format ###@##### where # is a digit and @ is a letter.")
);

Upvotes: 0

Karl-Henry Martinsson
Karl-Henry Martinsson

Reputation: 2795

You may want to look at this blog entry: http://www.bleedyellow.com/blogs/texasswede/entry/regular_expressions_in_notes_lotusscript

It explains how to use regexp in Lotusscript. You could simply add a check to the QuerySave event as well as to the Exiting event for the field.

Upvotes: 1

Phil M Jones
Phil M Jones

Reputation: 825

@Matches is a better solution, as you can check the precise pattern of characters, digits and punctuation.

Upvotes: 3

Thomas Adrian
Thomas Adrian

Reputation: 3636

You can put code in the fields input validation event that will check if the value is @IsNumeric and if so @Prompt the user

or you could do it using lotusscript in the query save event. using isnumeric and prompt the user using msgbox()

Upvotes: 0

Related Questions