I’m using Tom Select for one of my dropdowns in the form. The form has an option to dynamically add new rows to the form. The Tom Select works perfectly fine for the default row of the form, but it breaks when I add a new row by clicking on the button. additionally, it shows the error below.
Error populating dropdown: TypeError: Cannot read properties of
undefined (reading ‘trim’)
Here is my script. could you have any solution for this. I’m new to Javascript & Jquery.
Here are two screenshots of the first row and the second row which was added dynamically.
https://imgur.com/a/EbTM3Wa