掲示板
Custom Validation
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 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){
}
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
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
http://www.liferaysavvy.com/2014/01/objective-perform-form-validation-in.html