Repeated section - Append text depending on the textbox focus.


Badge +6

Good day!

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last .classText textarea').val(newString); 

I use this code for populating an item at the end of a repeated section of the row. However, is it possible to update a textbox dependent on where the focus is? For example, I have 3 rows, I want to update the 2nd row, is it possible to click the second row textbox and populate it again? If so, what code is it?


2 replies

Badge +7

You'll probably want to use the jQuery focus() method. Here's a good w3schools post on it: jQuery focus() Method

If you post more details of your form and code, I might be able to help you get the rest figured out.

Userlevel 5
Badge +14

it might be quite a problem to identify a row/control within repeating section having focus.

if you do it on an event out of repeating section focus is lost and you need not be able to identify where within repeating section it was before.

but if you want to do it on a textbox (within repeating section) onclick event, it should be doable. the logic is you have find up in a DOM tree textbox' parent row element, and then go down the tree to find respective target control.

see eg.  https://community.nintex.com/message/76653-re-loop-through-people-picker-extension?commentID=76653#comment-76653 

Reply