Skip to main content

i have a nintex form with repeating section. This section has some text fields and a choice field. I would like to change the color of the row based on the value selected in choice field. for example if choice is A then that row will be red color, if choice is G that row will be green color. How do i do that. i selected the repeater section -> add rule... how do i select choice column and check?

unfortunately it's not possible to apply rules on single repeating section's rows.

you will have to turn to  javascript to make it happen.

eg. following code that register onchange handler to respective choice control could do the trick

    NWF$('.ColorSelectorClass').change(function(evt){
           NWF$(evt.target).closest('.nf-repeater-row'))0].style.backgroundColor=evt.target.value;
     })
‍‍‍

I used color names directly as choice values

attached find small example form.


Thanks it worked for me, though i was not doing it through onchange event, but did it through onload of the form.


fine if that's enough for you.

note however, that colors will not change with choice change and as well this approach need not work for controls that are populated asynchronously (eg. lookups)


i have one more question, based on the color of the repeater control i wanted to disable or hide the delete icon (delete row) in the control. How do i do that? i dont want it in onchange event but on page load event...


quite similar way like you set colors.

I wouldn't write special condition that would disable the icon by color but rather set icon state along with the color.

the script to disable icon will look like:

NWF$(NWF$('.attachmentControlClass').find('.nf-attachmentsRow .nf-orphaned-attachment')[2]).find('.propertysheet a').prop('disabled','disabled')

p2] means 3rd attachment

I assumed EDIT form.


i mean delete button in repeater control. How do i get it


ups! sorry.

I somehow switched to wrong context happy.png

try this

NWF$(NWF$('.repeaterControlClass.nf-repeater .nf-repeater-row')[2]).find('img.nf-repeater-deleterow-image').hide();

p2] now means 2nd repeater row


Marian, I am looking to hide all delete icons from all repeating section rows on my form, by default. Looks like your code might do the trick, except I'm not sure how to combine the snippets. Can you guide me on this and where to place the code (I assumed Form settings/Custom JavaScript)


please post new question. it's another problem/topic and might need different code.

you can tag me in there so that I'm notified.

try to search the forum as well, I'm quite sure it has already been discussed several times.


Reply