How to take the value of a combo by name?

My combos are generated. Ex; : comboName1, comboName2, etc.
And they are used after by other scripts.
How to take the value of a combo by name ?

If you mean than you have array of combos and you need to get all the values, you can just iterate your array via method getActualValue()

var combos = [...]; var actualValues = []; for (var i=0; i<combos.length; i++){ actualValues = actualValues .push(combos[i].getActualValue()) }

Unfortunately, I don’t have array of combos.

So, haw many combos do you have and how you init them?

The number of combos is selected by user.

The (horrible) code:

... for(jj=0;jj<window.dialogArguments.length;jj++) { nlignes = jj; var code_js_listes_ajax = 'var comboLibelleDA'+nlignes+' = new dhtmlXCombo("libCim10_'+nlignes+'", "libCim10_'+nlignes+'", 1000);'+ 'var comboCodeDA'+nlignes+' = new dhtmlXCombo("liste_das_saisie_'+nlignes+'", "liste_das_saisie_'+nlignes+'", 100);'+ 'customizeDA_code(comboCodeDA'+nlignes+', comboLibelleDA'+nlignes+');'+ 'customizeDA_libelle(comboLibelleDA'+nlignes+', comboCodeDA'+nlignes+');'; addCode(code_js_listes_ajax); } ... function addCode(code){ var JS= document.createElement('script'); JS.text= code; document.getElementById('appendDiv').appendChild(JS); }


you can save combos into an array while adding with your script also you can extend your script:

nlignes = jj;
var code_js_listes_ajax =
‘var comboLibelleDA’+nlignes+’ = new dhtmlXCombo(“libCim10_’+nlignes+’”, “libCim10_’+nlignes+’”, 1000);’+
‘var comboCodeDA’+nlignes+’ = new dhtmlXCombo(“liste_das_saisie_’+nlignes+’”, “liste_das_saisie_’+nlignes+’”, 100);’+
‘customizeDA_code(comboCodeDA’+nlignes+’, comboLibelleDA’+nlignes+’);’+
‘customizeDA_libelle(comboLibelleDA’+nlignes+’, comboCodeDA’+nlignes+’);’;

var code_js_get_values = ‘function getActialValues(){var values=[];’;
nlignes = jj;
code_js_get_values += ‘values.push(comboLibelleDA’+nlignes+’.getActialValue());’+
code_js_get_values += ‘values.push(comboCodeDA’+nlignes+’.getActialValue());’;
code_js_get_values += ‘return values;}’;

anyway I strongly recommend you to white js code on a client side without generating it on server, this is very bad practice. if you need more help or tips or would like to hire team - please contact our sales dept ad, save your money and time :wink:

I added an array.
Thank you.