cancel
Showing results for 
Search instead for 
Did you mean: 

Validation function for an input field

Former Member
0 Kudos

Hi all,

I want to check an input field, if the user enter a numeric value, e.g. "A001" is wrong and the user gets an error. I tried it about the validation function, but I think there is no chance to use something like [a-z] as in java script.

Has anybody an idea?

Regards,

Marcel

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

can you use validation condition edit

select Form view Components

select Field -> Control

pop up Control Properties

select tab Validation

Condition -> select Test

value -> double click !! -> Validation Condition

type this or your formula

!(CHR(LEFT(@STR1,1))>64&&CHR(LEFT(@STR1,1))<91)

Former Member
0 Kudos

Hi Marcel,

Did you try to use the Validation function on the input field.

There are many options like

Contains

Not Contains

Is equal

Is Blank

Begin with etc. For example u needs to say contains a,b etc then throw error message.

I hope this will work for you in this case.

Regards

Ajay

Former Member
0 Kudos

Thx for the answer. But I know the options.

I would like to know if it's possible with a certain parameter like in JavaScript [a-z] or something like that, that an error message occurs for each lette between a to z with only one validation instead of 26 valdidations like:

Contains 'a' "Error message"

Contains 'b' "Error message"

Contains 'c' "Error message"

and so on.

26 times for a-z

26 times for A-Z

You understand what I mean?

Regards,

Marcel

Former Member
0 Kudos

Hi Marcel

I did this kind of validation

try this

Ask if the character is not in the ASCII number range

for the first character

!( (ASC(at(@str1,0))<48 && ASC(at(@str1,0))>57) )
You could do this for 4 digits, like this
!( (ASC(at(@str1,0))<48 && ASC(at(@str1,0))>57) && (ASC(at(@str1,1))<48 && ASC(at(@str1,1))>57) && (ASC(at(@str1,2))<48 && ASC(at(@str1,2))>57) && (ASC(at(@str1,3))<48 && ASC(at(@str1,3))>57) )

Best Regards from Peru¡