How to find the correct selector for a field inside repeating section

  • 8 December 2017
  • 1 reply
  • 3 views

Badge +3

Hello,

I have a form with a repeating section. I described in this thread that inside of this section is a field that I would like to format as a currency field. It seems to be difficult. So I think I have to use a Javascript and format that field when a "onblur" event is fired.
On another form I have a similar case and there we used a CSS Class "clsEuroFormat" defined at a single line textfield in the settings Formatting -> Control CSS class. The corresponding Javascript file contain this working function:

function:"$(document).on("blur", ".clsEuroFormat", function () {
            /* call a function e.g.  formatCurrency(this); */
            });

Following this example I definded a similar class for the field in the repeating section. But the event "onblur" is not fired when leaving the field.

My problem at this point is that I have not found out how to define correctly the selector (the blue colored string in the code above) and I don't know the reason. May be one part of the reason is that the field is inside the repeating section. Have I described it clearly so that you can understand my problem?

Thanks in advance.

Best regards

Martin


1 reply

Badge +3

Hello again,

now I got it working.

I was working with a class and I missed to call the registerEvents function within that class. That was the reason the event seems not to be fired. The selector is correct at that point.

best regards

Martin

Reply