Hi all, we have grid components in our forms. as you know, if grid has

Hi all,
we have grid components in our forms.
as you know, if grid has some invalid fields, the whole column will be in error status after clicking submit button.
that is not very user-friendly, especially we have some customized validation, like length check.

is there a way to heighlight the invalid fields only?

fyi, we are using Appian6.71.

online waiting for you.
thank you very much.
...

OriginalPostID-91765

OriginalPostID-91765

  Discussion posts and replies are publicly visible

Parents
  • i'm using Appian6.71.
    it seems it is different from what you said.it will validate the whole column.
    maybe my JS code is not corrent.my current logic is if any cell in one column is invalid,then the field is invalid.
    could you please take a look at it?

    //this function is supposed to validate lenth
    //both ordinary text field and grid text field.
    function checkFieldLength(fieldId,length,isGrid){
              var value = window.FormAPI.getValue(fieldId).id.trim();
              
              //is grid field
              if(isGrid){
                        //value of grid field contains multiple values which are joined by ";"
                        var valueArr = value.split(";");
                        for(var i=0;i<valueArr.length;i++){
                                  valueArr[i] = valueArr[i].trim();
                                  
                                  //return false if any cell in the column is invalid
                                  if(valueArr[i] && valueArr[i].length > length){
                                            return false;
                                  }
                        }
              }else{
                        if(value && value.length > length){
                                  return false;
                        }
              }

              return true;
    }
Reply
  • i'm using Appian6.71.
    it seems it is different from what you said.it will validate the whole column.
    maybe my JS code is not corrent.my current logic is if any cell in one column is invalid,then the field is invalid.
    could you please take a look at it?

    //this function is supposed to validate lenth
    //both ordinary text field and grid text field.
    function checkFieldLength(fieldId,length,isGrid){
              var value = window.FormAPI.getValue(fieldId).id.trim();
              
              //is grid field
              if(isGrid){
                        //value of grid field contains multiple values which are joined by ";"
                        var valueArr = value.split(";");
                        for(var i=0;i<valueArr.length;i++){
                                  valueArr[i] = valueArr[i].trim();
                                  
                                  //return false if any cell in the column is invalid
                                  if(valueArr[i] && valueArr[i].length > length){
                                            return false;
                                  }
                        }
              }else{
                        if(value && value.length > length){
                                  return false;
                        }
              }

              return true;
    }
Children
No Data