掲示板

Custom Validation

7年前 に Madhukara Patel によって更新されました。

Custom Validation

Junior Member 投稿: 46 参加年月日: 15/03/23 最新の投稿
Hello,

I want to add custom validation for text fields.
But i have to call default function for custom validation.

Means i am not writing any function in body .

below i written function in body instead of this i want to call default general function for validation . Like mentioned in yellow color . Please help me to out this.
{
body: function (val, fieldNode, ruleValue) {
var result = false;
if (val >=18) {
result = true;
}
return result;
},
custom: true,
errorMessage: 'Age must More than 18 years',
fieldName: '<portlet:namespace/>var2',
validatorName: 'custom_rule_age'
},];



function regxp(val, fieldNode, ruleValue){
}
7年前 に Madhukara Patel によって更新されました。

RE: Custom Validation

Junior Member 投稿: 46 参加年月日: 15/03/23 最新の投稿
Madhukara Patel:
Hello,

I want to add custom validation for text fields.
But i have to call default function for custom validation.

Means i am not writing any function in body .

below i written function in body instead of this i want to call default general function for validation . Like mentioned in yellow color . Please help me to out this.
{
body: function (val, fieldNode, ruleValue) {
var result = false;
if (val >=18) {
result = true;
}
return result;
},
custom: true,
errorMessage: 'Age must More than 18 years',
fieldName: '<portlet:namespace/>var2',
validatorName: 'custom_rule_age'
},];



function regxp(val, fieldNode, ruleValue){
}


I want call that function like general function
function regexp(){
}

this function i want call in custom validation
thumbnail
7年前 に Nikhil Nishchal によって更新されました。

RE: Custom Validation

Regular Member 投稿: 177 参加年月日: 12/06/22 最新の投稿
You can go through this:
http://www.liferaysavvy.com/2014/01/objective-perform-form-validation-in.html