In a form i have almost 20+ fields with value of Field ID having the pattern &qu

In a form i have almost 20+ fields with value of Field ID having the pattern "fldProposal_"; When the form loads, instead of writing 20+ javascript statements that disable each field, any idea how to write a general purpose code that loops through all the 20 fields and disables each?...

OriginalPostID-30653

OriginalPostID-30653

  Discussion posts and replies are publicly visible

Parents
  • You can use a similar approach to what I posted here forum.appian.com/.../3518 on Dec 15, 2011.

    If all your fields have an ID (given in the FORMS DESIGNER not in the DOM itself) that follows a naming convetion you can do something like this:

    function toggleEnabledFlag(prefix,fieldsToDisableArray){
    for(var i = 0; i < fieldsToDisableArray.length; i++){
    var componentDom = window.Build.util.getComponentContainer(prefix + fieldsToDisableArray[i], window.FormDesigner.runtimeNamespace);
    if (componentDom.length > 0) {
    componentDom.get(0).disabled=true;
    }
    }
    }
Reply
  • You can use a similar approach to what I posted here forum.appian.com/.../3518 on Dec 15, 2011.

    If all your fields have an ID (given in the FORMS DESIGNER not in the DOM itself) that follows a naming convetion you can do something like this:

    function toggleEnabledFlag(prefix,fieldsToDisableArray){
    for(var i = 0; i < fieldsToDisableArray.length; i++){
    var componentDom = window.Build.util.getComponentContainer(prefix + fieldsToDisableArray[i], window.FormDesigner.runtimeNamespace);
    if (componentDom.length > 0) {
    componentDom.get(0).disabled=true;
    }
    }
    }
Children
No Data