How does form validation work?

You can set simple expressions for each control in the Custom Validation field in the Others tab.

Form validation

Read more on this here. Another option is to use JavaScript in Action Handlers. To do that, declare the following function:

{
    validate: function (args /*{data, originalData, state, component, formName, index, controlRef, eventArgs, isChild}*/){
        var errors = {};
        //TODO: Insert your code for validation this form
        if(data.name == undefined || data.name == ''){
            errors.name = 'This field is requered!';
        }
        if(errors.name){
            throw {
                level: 1,
                message: 'Check errors on the form!',
                formerrors: errors
            };
        }
        return {};
    }
}