Hi
I am designing an offline tool. The idea is :
1) I have three level dependent drop down list.
2) The name say is :Main(having A,B and C as drop down options), Option2(drop down based on selection of A, B or C, showin in the code below) and Option3(based on the selection of options from drop down option2, shown in the code below).
3) there is a "Go" button on the page , which on being pressed, should capture and display the value selected in drop down and display the result in 'Result based on selection' part , which is the lower half of the page.
The bottom half part of the page is named as 'Result based on selection'. In this section , whatever is selected by the user, on pressing "Go" , should be displayed (printed). Not just one, any number of selections on pressing Go should keep on getting added one below the other.
Please help me in capturing and printing the results. Most of the part is done. The code is pasted here:
<!--//Code Begins here -->
<script type="text/javascript">
var option = new Array();
option['A'] = new Array('A1','A2','A3','A4');
option['B'] = new Array('B1','B2','B3','B4');
option['C'] = new Array('C1','C2','C3','C4');
// iss List
var WTFissList = new Array();
WTFissList['A'] = new Array();
WTFissList['A']['A1'] = new Array('A11','A12','A13','A14');
WTFissList['A']['A2'] = new Array('A21','A22','A23','A24');
WTFissList['A']['A3'] = new Array('A31','A32','A33','A34');
WTFissList['A']['A4'] = new Array('A41','A42','A43','A44');
WTFissList['B'] = new Array();
WTFissList['B']['B1'] = new Array('b11','b12','b13','b14');
WTFissList['B']['B2'] = new Array('b21','b22','b23','b24');
WTFissList['B']['B3'] = new Array('b31','b32','b33','b34');
WTFissList['B']['B4'] = new Array('b41','b42','b43','b44');
WTFissList['C'] = new Array();
WTFissList['C']['C1'] = new Array('NA','NB');
WTFissList['C']['C2'] = new Array('CO','CT');
WTFissList['C']['C3'] = new Array('C23','Cy');
WTFissList['C']['C4'] = new Array('Fi','Ot');
function WTFissSet() {
MainSel = document.getElementById('MainissID');
issID = option[MainSel.value];
changeSelect('Option2', issID, issID);
setissList();
}
function setissList() {
MainSel = document.getElementById('MainissID');
WTFissMid = document.getElementById('Option2');
WTFFinalList = WTFissList[MainSel.value][WTFissMid.value];
changeSelect('Listofiss', WTFFinalList, WTFFinalList);
}
function changeSelect(fieldID, newOptions, newValues) {
selectField = document.getElementById(fieldID);
selectField.options.length = 0;
for (i=0; i<newOptions.length; i++) {
selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
}
}
function displayResult()
{
// Write your logic here and place the result to the below statement;
document.getElementById('resultpanel').innerHTML = "<b>--logic of Result has not been implemented--<b>";
}
function setResult(result)
{
// Write your logic here and place the result to the below statement;
Bookmarks