Hi Team
In detail wizard, there are four label fields in that I am tried validation on Name of Degree It allows only Alphabets if u enter Numerically it shows an alert box please enter valid text format.
the same process I am trying for another field (Institute name) but it's not working .please help me in this situation.
please check the following code once
Please find the attachment below.
Hoping For positive reply
methods: {
save: function()
{
var msg = this.Nameofdegreevalidation();
if (msg.invalidMessage !== "") {
this.showInformationDialog(msg.invalidMessage);
return;
}
this.callParent(arguments);
},
Nameofdegreevalidation: function() {
// Variable for storing a validation error message.
var invalidMessage = "";
// Variable for stroing the number check result.
var isValid = true;
// Variable for the phone number.
var number = this.get("UsrNameOfDegree");
// Determining the correctness of the number format using a regular expression.
isValid = (Ext.isEmpty(number) ||
new RegExp(/^[A-Za-z]+$/).test(number));
// If the format of the number is incorrect, then an error message is filled in.
if (!isValid) {
invalidMessage = this.get("Resources.Strings.InvalidPhoneFormat1");
}
// Object which properties contain validation error messages.
// If the validation is successful, empty strings are returned to the object.
return {
invalidMessage: invalidMessage
};
}
},
Like
Dear Manikanta,
Your code is working, I have tested on the text column on my instance. Unfortunately, it is not possible to tell what is going wrong without debugging the code. Please consider debugging your code to see at what step the code performs differently from the working field. Use browser developer tools for debugging.(F12)
Regards,
Anastasia