5 Replies Latest reply on Oct 15, 2015 7:30 PM by famruch

    Naming Elements Dynamically

    famruch Level 1

      Hi Guys,

      Does anyone know if it is possible to name adaptive form elements dynamically? For example if I have a textbox and a radio button, is it possible to code this logic into the textbox or radio button

      if radiobutton.value == 1, then textbox element name = first

      Thanks guys,


      • 0. Re: Naming Elements Dynamically
        famruch Level 1

        Thanks Sakshi

        Much appreciated.


          • 1. Re: Naming Elements Dynamically
            Sakshi Level 2

            This can be achieved by css, If you see the Adaptive Form created using 'survey' template, it has each question prefixed by an incremental number, if one question is hidden, the numbers readjust. Also this can be seen in Adaptive Form created using 'simple enrollment' template, each panel title is prefixed with a number, if a panel is hidden (its visibility expression computes to false) the prefixed number readjusts according to series. Following is the css code governing these behavior:

            //survey styles.less snippet .panel { counter-reset:section; } .panel .guidefield .guideFieldLabel:before { counter-increment: section; content: counter(section) ". "; padding-right: 5px; font-size: 17px; }
            // simple enrollment styles.less snippet .wizard-navigators { text-transform: uppercase; > li { border: none; outline: none; &:before { border-width: 0px; margin-right: 10px; content: counter(item); .rounded-corners(5px); padding: 3px 8px; color: #ffffff; font-size: @tabs-font-size; background-color: @wizard-tabs-font-color; } }
            • 2. Re: Naming Elements Dynamically
              famruch Level 1

              Hi Deepak,

              Slightly different request. Do you know any good links you can recommend to me on how to pre populate AEM adaptive forms using data from a web service?

              Thanks mate.


              • 3. Re: Naming Elements Dynamically
                famruch Level 1

                Thanks Deepak

                Basically I have a radio button which dynamically hides/displays entire sections of an adaptive form.

                The issue is each section is number i.e. 1. section 1, 2. section 2, 3. section 3

                I was hoping that when a section gets hidden, for instance 2. section 2, I can rename 3. section 3 as 2. section 2

                Kind Regards,


                • 4. Re: Naming Elements Dynamically
                  deepak k. Adobe Employee

                  No, this is not supported.

                  What is the use case? May be I can help you with some alternate suggestion.