I want to pass the text (<option>[B]THIS TEXT IS TO BE PASSED
I also need it to work with my existing code:
HTML file-
[CODE]<html><head>
<script language=javascript src=”chose.js”></script></head>
<body>
<form id=selectFRM>
<table>
<tr><td>
<table>
<tr>
<td>Selection #1</td></tr>
<tr>
<td><select id=sel1 name=sel1 STYLE=width:250 onChange=”populateNxt(this, selectFRM.sel2, arrItems1, arrItemsGrp1)”><option selected>Start Here
<option value=1>Selection 1 Option 1
<option value=2>Selection 1 Option 2
<option value=3>Selection 1 Option 3</select></td></tr>
<tr>
<td>Selection #2</td></tr>
<tr>
<td><select id=sel2 name=sel2 STYLE=width:250 onChange=”populateNxt(this, selectFRM.sel3, arrItems2, arrItemsGrp2)”></select></td></tr>
<tr>
<td>Selection #3</td></tr>
<tr>
<td><select id=sel3 name=sel3 STYLE=width:250></select></td></tr>
</table></td>
<td>
<table>
<tr>
<td> </td></tr>
<tr>
<td><input type=text readonly id=txt1></td></tr>
<tr>
<td> </td></tr>
<tr>
<td><input type=text readonly id=txt2></td></tr>
<tr>
<td> </td></tr>
<tr>
<td><input type=text readonly id=txt3></td></tr>
</table></td></tr>
</table>
</form>
</body></html>
and the [B]chose.js
[CODE]var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[1] = “Selection 2 Option 1 from (Option 1)”;
arrItemsGrp1[1] = 1;
arrItems1[2] = “Selection 2 Option 2 from (Option 1)”;
arrItemsGrp1[2] = 1;
arrItems1[3] = “Selection 2 Option 2 from (Option 2)”;
arrItemsGrp1[3] = 2;
arrItems1[4] = “Selection 2 Option 2 from (Option 2)”;
arrItemsGrp1[4] = 2;
arrItems1[5] = “Selection 2 Option 1 from (Option 3)”;
arrItemsGrp1[5] = 3;
arrItems1[6] = “Selection 2 Option 2 from (Option 3)”;
arrItemsGrp1[6] = 3;
var arrItems2 = new Array();
var arrItemsGrp2 = new Array();
arrItems2[1] = “Selection 3 Option 1 from (Options 1,1)”;
arrItemsGrp2[1] = 1
arrItems2[2] = “Selection 3 Option 1 from (Options 1,2)”;
arrItemsGrp2[2] = 2
arrItems2[3] = “Selection 3 Option 1 from (Options 2,1)”;
arrItemsGrp2[3] = 3
arrItems2[4] = “Selection 3 Option 1 from (Options 2,2)”;
arrItemsGrp2[4] = 4
arrItems2[5] = “Selection 3 Option 1 from (Options 3,1)”;
arrItemsGrp2[5] = 5
arrItems2[6] = “Selection 3 Option 1 from (Options 3,2)”;
arrItemsGrp2[6] = 6
function populateNxt(control, controlToPopulate, ItemArray, GroupArray) {
var myEle ;
var x ;
for (var q=controlToPopulate.options.length;q>=0;q–) controlToPopulate.options[q]=null;
if (control.name == “sel1”) {
for (var q=selectFRM.sel3.options.length;q>=0;q–) selectFRM.sel3.options[q] = null;
}
myEle = document.createElement(“option”) ;
myEle.value = 0 ;
myEle.text = “Next” ;
controlToPopulate.add(myEle) ;
for ( x = 0 ; x < ItemArray.length ; x++ ) {
if ( GroupArray[x] == control.value ) {
myEle = document.createElement(“option”) ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}