You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Possibility to increment a label by + 1 in a collection for every addition of new set of fields.

posted on May 16, 2017

Hi all,

I have a collection set of 50 values. The 'Single Line 2' label will be in the first position and for every 'add' of a new set of fields, the 'Single Line 2' label should be evaluated to +1. Please see a screenshot for your understanding.

Is this feasible to change the label of 'Single Line 2' to 'Single Line 3' for every addition of fields? Please note that this will increment till 50.

Thanks

Sheila

0 0
replied on May 19, 2017

Hi Michelle,

I have tested your code and adapted it on a header (h4). Infact, I have applied the automatic numbering after the h4.

I just want to add a space between 'My Text' and the automatic number as it is currently displaying as 'My Text1'. I want it to be like 'My Text 1' instead.

Please see codes:

body {

counter-reset: h4counter;

}

h4:after {
     content: counter(h4counter) "\0000a0\0000a0";
     counter-increment: h4counter;
}

Please help

0 0
replied on May 19, 2017

Can you put a space at the end of the label?  

Label(sp)

should make Label 1

Honestly, I'm not a coder - so the simplest solutions are the best for me.  I'm sure you could code the space in, but I don't know how.

0 0
replied on May 21, 2017

Hi Michelle,

I have used h4 instead of label. I just need to add a space between the automatic numbering and the h4 text.

Thanks to help.

 

0 0
replied on May 16, 2017

I added this to my CSS section of my form in 10.2 - it numbers the sections

body {
  	counter-reset: h4counter;
}
h4:before {
  	content: counter(h4counter) ".\0000a0\0000a0";
  	counter-increment: h4counter;
}

 

This isn't a single line - it's the section, but maybe it could be adjusted to work with the single line instead of the header (h4)

2 0
replied on May 16, 2017

Yep, Michelle's code can be adapted:

  1. Assign a class like "countMe" to the fields which you want to be incremented.
  2. Replace the selector "h4:before" with ".countMe:before".
  3. (optional) Rename the counter.
  4. Update the content property as appropriate.
0 0
replied on May 16, 2017

Hi James,

How do I update the content property as appropriate? For me, it should be the label that should be incremented. If you can please brief a bit.

Also, Michelle has used a header (h4) to increment it. please confirm.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.