Naming Elements Dynamically

Avatar

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
famruch
Level 1

15-10-2015

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,

Afam

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 1
Level 2
Sakshi1
Level 2

Likes

2 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Boost 1
Affirm 5
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
Sakshi1
Level 2

Likes

2 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Boost 1
Affirm 5
Affirm 3
Affirm 1
View profile
Sakshi1
Level 2

15-10-2015

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; } }

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
famruch
Level 1

15-10-2015

Thanks Sakshi

Much appreciated.

Afam

Avatar

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
famruch
Level 1

15-10-2015

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,

Afam

Avatar

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
famruch
Level 1

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
famruch
Level 1

15-10-2015

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.

Afam

Avatar

Avatar
Boost 5
Employee
deepak_k_
Employee

Likes

5 likes

Total Posts

84 posts

Correct reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Employee
deepak_k_
Employee

Likes

5 likes

Total Posts

84 posts

Correct reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
deepak_k_
Employee

15-10-2015

No, this is not supported.

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