-
hello everyone i try to make a validation for a field i write the following code in the dialog.ts but it dosent work correctly this.form.Username.addValidationRule(this.uniqueName, x => {
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Check out the password length validation in ChangePasswordPanel.ts. You say it is a number though, so maybe try add the [IntegerEditor(MinValue = 1000000000)]
[DisplayName("National ID"), Size(10), NotNull, QuickSearch]
public Int64? NationalID
{
get { return Fields.NationalID[this]; }
set { Fields.NationalID[this] = value; }
} |
Beta Was this translation helpful? Give feedback.
-
And if you change your validation rule to check the length of the value, and not the element (like in the password length validator)? this.form.Username.addValidationRule(this.uniqueName, x => {
// Your example is using this.form.Username.element.length
var nationalID = this.form.Username.value.length;
if (nationalID !=10) {
return "National ID is too short"
}
}) |
Beta Was this translation helpful? Give feedback.
And if you change your validation rule to check the length of the value, and not the element (like in the password length validator)?