Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Custom value supported igCombo with max length validation.
posted

Hi,

I having igCombo like 

$("#ContainerId").igCombo("option", "allowCustomValue", true);

Over that there is need to have validation like max length, which is not supported yet. I tried like shown below, but didn't help. 

$("#ContainerId").igCombo("option", "validatorOptions", {maxLength : 25});

Let me know how we can implement this.

Regards,

Manish Jain

Parents
No Data
Reply
  • 16310
    Offline posted

    Hello Manish,

    You can use the lengthRange property to set validation for min/max number of selected items for the combo - please see this example https://www.igniteui.com/validator/overview (the Your interests combo).

    To perform validation over the combo value length, you need to implement a custom validation function:

        validatorOptions: {
         custom: {
          method: function(value, opts) {
           if(value.length > 25)
            return false;
           else
            return true;
          },
          errorMessage: "Value exceeds length !",
         },
        },

Children
No Data