Hi,As i am currently working with IGgrid, but the default validation of textbox allows the "spacebar" and enters a blank space even if you don't add any value in text box and it saves the data even if it is empty.
This is default validation, it accepts blank space before we enter any character, so if i just press spacebar on textbox, it considers that as a value.
setting.ColumnSetting().ColumnKey("CustomerValue").EditorType(ColumnEditorType.Text).Required(true).Validation(true);
I need help for setting up custom validation for same, below is the jquery i wrote, it works for textbox but it display the message as alert, i want the message as defualt ie: "This field is required" on top of textbox
var emptyCustomerValue = ui.values.CustomerValue.trim().toLowerCase(); var isEmptySpace = emptyCustomerValue.replace(/^\s+|\s+$/g, ""); if (isEmptySpace === "") {terminationReasonMappingGrid.showModel(terminationReasonMappingGrid.constants.commonErrorTitle, terminationReasonMappingGrid.constants.emptySpacesNotAllowed); isClickedOnSave = false; return false; }
});
The above code displays it in Alert window
Implementing custom validation for a textbox in IGGrid involves setting specific rules to ensure data integrity. Use the grid's built-in validation options to define criteria like character limits, required fields,centurylink support phone number or pattern matching. By customizing these validations, you can prevent invalid entries, enhance user input accuracy, and maintain high data quality within your application.
Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many.
really helpful suggestion.
Hello,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Riva IvanovaEntry Level Software Developer
Thank you so much.