Portal Engine
Version 3.x > Portal Engine > Validation - Regular Expression View modes: 
User avatar
Member
Member
GMichalek-cogeco - 10/22/2008 8:35:36 AM
   
Validation - Regular Expression
Hi,

Yet another newbie question here. I am creating a new document type and as I am adding fields I would like to enforce certain rules to ensure data integrity. I see in the vaidation section for the field a place to enter a regular expression.

So for a real simple one for example the field cannot be left blank, would I enter: IS NOT NULL which is basically what I would do in Sql Server? Is there a listing anywhere of what regular expressions are available for validating fields as I have not been able to find on in any of the documentation?

Thanks

Gary

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/22/2008 9:21:41 AM
   
RE:Validation - Regular Expression
Hi,

When defining a new filed for the document type (or for bizform) there is a check box "Allow empty value" - when checked, the field could be left empty, if not checked, appropriate value is awaited for the field type.

In the validation fields you can use the standard .NET regular expressions. For example - http://regexlib.com/


Best Regards,
Juraj Ondrus

User avatar
Member
Member
ndeych-gmail - 10/5/2009 10:09:02 AM
   
RE:Validation - Regular Expression
How can I specify a custom error message if the field is left empty but is required? Write now it just says "Please enter some value."

I tried putting a message for each field under the validation section but it does not appear, seems like its only for the regex validation.

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 10/8/2009 7:24:42 AM
   
RE:Validation - Regular Expression
Hello,

You can set following value into 'Min length' field in Validation section: 1
Then you can specify message that will be displayed if field is empty into 'Error message' field.

Best Regards,

Martin Dobsicek