validation is empty or is unique value

ErnstJan

Member
Hello,

In a form I have a field element in which they have to put a number, example 213456789, or if they don't have a number, this field stays empty. This number is a unique value. Is it possible to have combined these two validations (is unique value or is empty). If possible how to achieve this?
Just let me know.

Kind regards, Ernst
 
In the isunique validation set the condition:
return '{your-table___element}'!='';
So it's only validating if the element is not empty.
 
validating is unique value or is empty

Thanks Troester,

Works perfect! Last question: is it possible to say this unique value only has nine numbers example: 012345678 or 993456782 (without any other character like , :?# etc) ?
Just let me know.

Kind regards, Ernst
 
You can add a regular expression validation (there have been some threads about validating telephon numbers).
 
validating is unique value or is empty and regular expression

Hello Troester,

Thanks for very quick reply! I found this regular expression and changed it a little:
/^[0-9]{9}$/ I also added condition if field is left empty. Everything works fine now!
I appreciate your help very much!


Kind regards, Ernst
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top