Hi everybody,
After trying to resolve my problem with the Nintex support, they suggest to me to create this question on dev talk.
In fact, the problem concern JS on forms so they can't help me.
My problem is the custom validation function in a textarea or other placed in a repeating section.
This custom validation function is only fired for the first line of repeater, after that when to add more lines, custom validation function is never called.
This function is just a call to my method JS included to the form, it permit to replace commas by dots to prevent bad calculation of amount by Nintex (decimal separator VS thousand separator).
Anyone know how can I work around my problem with JS or not... I've already try to use validation rules, regex but it doesn't work when the textarea is define as a double value instead of string by default.
Thank you a lot for your time
Best regards.
Solved! Go to Solution.
You can use Nintex Forms RepeaterRowAdded event to bind an event handler to the "change" JavaScript event of form fields.
Hi Max,
If you are just calling a function , you can just use a calculated control and hide it under some control, don't make visible false for the calculated control. Pass the row number to the function.
from my point of view this is definitely a bug!
what I've investigated it works like this
for single line text control I found following workaround myself
(note, the code only causes to fire custom validation on control's content change event. it doesn't prevent the validation to be fired during new row construction)
NWF.FormFiller.Events.RegisterRepeaterRowAdded (function () {
var repeaterRow = NWF$(arguments[0][0]);
repeaterRow.find(".nf-associated-control")[0].onchange=NWF$(repeaterRow.siblings()[1]).find(".nf-associated-control")[0].onchange;
repeaterRow.find(".nf-associated-control")[0].Validators =
NWF$(Page_Validators).filter(function(idx,elem){
return elem.controltovalidate==repeaterRow.find('.nf-associated-control')[0].id;
})
});
Hi,
Thank you for this great response, I will try this as soon as possible.
I will return back to you to inform about the successfully method.
Have a good day !
I was looking at your post, trying to solve a similar issue I am having on a form and had a few questions. In your work-around, you are doing a find for ".nf-associated-control". Is this a CSS class that you have assigned to the control that you are monitoring for a change? I have a form with a repeating section that is going to be used for scheduling meetings. The form has a start time and end time date/time field and what I am trying to do is set the date of the end time to be the same as the date entered in the start time. This works on the first row (as you mentioned), but is not working on any new rows. I tried adding the function you posted, but it didn't seem to work. Any guidance or help you can provide would be appreciated.
Thanks,
Charles Ralston
you are doing a find for ".nf-associated-control". Is this a CSS class that you have assigned to the control that you are monitoring for a change?
no, it's nintex' internal class.
try to explore DOM how/where it is assigned.
This works on the first row (as you mentioned), but is not working on any new rows. I tried adding the function you posted, but it didn't seem to work.
this topic and my post deals with validations, setting/copying a control's value is something different.
for setting a date control with repeating section I would suggest to go through following thread Having fun with Date / Time in Nintex Forms
Maxime TRIVIDIC, Did you get this resolved?