Hi,
I use the following script below to exstract a value from an array and display it on the page depending on what value was selected from a drop down menu, what I would also like to do is then also add the value to a hidden form field but I am not sure how I can get the value into the field. the section in red is how I thought I might do it but it doesn't work. JS is not my strong point so any help would be great
Many thanks
Peter
var NODE = <%=arrNode%>
function showResult(sel){
document.getElementById("disp").innerHTML = " " + NODE.find([sel.options[sel.selectedIndex].value]);
document.form1.cil_name.value = NODE.find([sel.options[sel.selectedIndex].value]);
}
//this creates a new array function for the arrNode Array
NODE.find = function(what){
var i=0;
for (;this!=what && i<this.length-2;i+=2){}
if (this==what) return this[i+1]; else return false;
}