I have a multiline combo defined like this:
myCombo = new dhtmlXCombo(myForm.getContainer("combo_zone"), "combo", 360, "my_multiline", true);
myCombo.setTemplate({
input: "#typedesc#",
option: "<div style='position:relative; width:100%; float: left; border:solid 3px white;' >"+
"<div id ='stcombo_type' style='color:#112a3d; width:15px; text-align:left; margin-left: 5px; float:left;'>#type#</div>"+
"<div style='color:#112a3d; width:80px; text-align:left; margin-left: 10px; float:left;'>#typedesc#</div>"+
"<div id='stcombo_elig' style='color:#112a3d; width:35px; text-align:right; margin-left: 5px; float:left;'>#eligible#</div>"+
"<div id='stcombo_used' style='color:#112a3d; width:35px; text-align:right; margin-left: 5px; float:left;'>#used#</div>"+
"<div id='stcombo_appr' style='color:#112a3d; width:35px; text-align:right; margin-left: 5px; float:left;'>#app#</div>"+
"<div id='stcombo_req' style='color:#112a3d; width:35px; text-align:right; margin-left: 5px; float:left;'>#req#</div>"+
"<div id='stcombo_avail' style='color:#112a3d; width:35px; text-align:right; margin-left: 5px; float:left;'>#avail#</div>"+
"</div>"
});
myCombo.addOption([
{value: "heading", text: {type: " ", typedesc: "Type", eligible: "Eligible", used: "Used", app: "Appr", req: "Req", avail: "Avail"}},
{value: "Vacation", text: {type: "VC", typedesc: "Vacation", eligible: eligVC , used: usedVC , app: apprVC, req: reqVC, avail: availVC}, selected: true},
{value: "Sick", text: {type: "SK", typedesc: "Sick", eligible: eligSK, used: usedSK, app: apprSK, req: reqSK, avail: availSK}},
{value: "Sick Unpaid", text: {type: "SU", typedesc: "Sick Unpaid", eligible: eligSU, used: usedSU, app: apprSU, req: reqSU, avail: availSU}}
]);
In javascript, I can retrieve the selected text from Combo like this:
var myComboSelected = myCombo.getComboText();
alert(myComboSelected); // Returns "Vacation"
alert(??WHAT??); // Returns VC or SK or SU
But I want to get the “VC” as the response.
I tried using
document.getElementById(“stcombo_type”).innerHTML. But I dont think its correct. Could you please tell me how I can get “VC” as the return value? Or If I select Sick, how to get “SK”? or “SU” when I select “Sick Unpaid”
Many Many thanks,
SNS