I am curious about how to identify the selected language tab when uploading a file from a set of dynamically generated tabs. It is important for me to capture and pass on the language that has been chosen.
In this scenario, I have specifically clicked on the French language tab within the third set of tabs. This is the set from which the file will be uploaded. Now, my task is to determine the language selected so that I can include it in my ajax call. https://i.sstatic.net/s3kLP.png
Below is the function used to create new tabs:
function buildTabsNew() {
var questions = jsonResponse;
var newTabs = [];
var langlength = questions[0].DetailLanguages.length;
console.log(questions[0].DetailLanguages);
for (var k = 0; k < langlength; k++) {
counter++;
languageSelected = questions[0].DetailLanguages[k].Language_Name;
var tabsArray = {
paneId: "paneid-" + counter,
title: questions[0].DetailLanguages[k].Language_Name,
content: '<textarea class="textarea-' + hash + k + '" placeholder="' + questions[0].DetailLanguages[k].Language_Name + '" style="width: 100%; height: 200px; font-size: 14px; line-height: 18px;"></textarea><div id="uploadFile-' + hash + k + '"></div>',
active: k == 0 ? true : false,
disabled: false
};
newTabs.push(tabsArray);
console.log(newTabs);
}