Forums

Update other fields of repeater via ajax request after selecting a description of dropdown

rotocal 14 May, 2020
Dear friends good morning hope everyone is in a good health.
This is the situation I have a form that includes a header(see H in the picture) for a requisition: Nr, Supplier, Requestor, Select buyer, date, and other.
In the same form below is a repeater area that shows requisition lines (see R in the picture below) : LnNumber(Ln), Item, Description (Descripcion), Price (Precio Unit), etc...

This is what I need : as soon I select the Description (dropdown), triggers and event function (I already have this from the event tab of this field = MyFunc). I did that because the id of this input field (dropdown) change with every line DataLn0descripcion_descripcion for the first line, DataLn1descripcion_descripcion for the second line and so one. Therefore I can not create an addEventListerner... since id of field is changing with every line.

1. Event triggered function (MyFunc) needs to know the line number of the repeater (0,1,2,3,4...) or at least the id (DataLn0descripcion_descripcion for instance... 1st line)
2. $.ajax request needs to work .. from HTML custom </>HTML or from </>Javascript custom section. The problem that I have is that the function MyFunc doesn't work when it is included in a custom </> Javascript section with the flag "add inside domready event" = ON. need to update what is marked with 1,2,3,4 in red below
Please help

rotocal 20 May, 2020
Any answer please ?? how to get the id (Not the value or content of field) of a dropdown field in a repeater.
I need to know the row number of current repeater line passed to JS event triggered by the dropdown field "Descripcion" when is changed.
Thank you
Max_admin 20 May, 2020
Hi rotocal,

I'm not sure if this will be possible in v6, the reload sends the data of the whole form, so you will need to have a field with the value you need, you may need to set this field value just before the reload, I did not do that before.

however, in v7 it's possible to choose the data scope of the AJAX request, which means that you can limit it to the single repeater entry you are working with, but to use that you will need to rebuild your form!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.