Validator of HTML form parameter

The Alinous-Core has validator function.

Standard validator is default function and you don't have to write validation logic. Custom validator is to write your custom validation logic.

In this page, I'll show you how to use standard validator.

Standard validator

 It is best way to take a look at next sample code using validator.

In order to use validate, add attributes below, like sample code.

alns:msg name of input, select or textarea tag
alns:form form's name the input tag is contained.
alns:validate validator name. If you use multiple validator, separate by ",".

 

Next I'll show you the type of validators set as value "alns:validate".

notnull

If the input is blank string or not selected, return error.

int

If the inputed string is not integer format, return error.

uint

If the inputed string is not formatted as integer greater than 0 or 0, return error.

double

 If the inputed string is not double format, return error.

udouble

If the inputed string is not formatted as double greater than 0 or 0, return error.

regex

If the inputed string does not match specified regular expression, return error.

The expression is specified in "alns:regexp" attribute. Format of regular expression is same with Java language, because Alinous-Core use it.


Go to Top