reportingbuzz
MIS
Hi,
I have a function which shows and hides an org tree. For every person I click on, i take the empid of the person and store it in a string. As I show, I add the person's empid to the string. As I hide, I remove the person's empid from the string. Within the function, how can I can populate a hidden textbox with the string above mentioned. I do not see the function populating the hidden box which is now visible.
javascript function is:
My HTML hidden box is:
The tree in HTML is:
I have a function which shows and hides an org tree. For every person I click on, i take the empid of the person and store it in a string. As I show, I add the person's empid to the string. As I hide, I remove the person's empid from the string. Within the function, how can I can populate a hidden textbox with the string above mentioned. I do not see the function populating the hidden box which is now visible.
javascript function is:
Code:
function s_Hide(el){
elID = 'UI_'+el;
//alert(elID);
obj = document.getElementById(elID).style;
(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
//Need to store the current state on a cookie - old comment
//Need to store the current state in a string in a text field.
var uniqueStr = '&' + el + '&'
//var uniqueStr = '&' + elID + '&'
var openedItems = "" //Added 2/9/07
if (obj.display == 'block')
{
// add it to the string openedItems
alert("Add '" + uniqueStr + "'");
openedItems = openedItems.concat(uniqueStr);
}
else
{
// remove it from the string openedItems
alert("Remove '" + uniqueStr + "'");
openedItems = openedItems.replace(uniqueStr, '');
}
alert('s_hide - LastAlert:'+openedItems);
//Store the openedItems info in the hState hidden text box.
document.commissions.hState.value = openedItems;
}
My HTML hidden box is:
Code:
<input type="text" name="hState" value="">
The tree in HTML is:
Code:
<ul id="menu">
<li>
<input type="radio" checked ="checked" value="22979" name="empid" onClick="showReports(this.value)">
<a href="#" class="a_style" onclick="s_Hide('22979'); return false;">Reinhard Nagel</a>
<font size=1>(22979)</font>
<ul id="UI_22979" style="display: none">
<li>
<input type="radio" value="8208" name="empid" onClick="showReports(this.value)">
<a href="#" class="a_style" [b]onclick="s_Hide('8208'); return false;"[/b]>Patrick Cox</a>
<font size=1>(8208)</font>
<ul id="UI_8208" style="display: none">
<li>
<input type="radio" value="40801" name="empid" onClick="showReports(this.value)">
Manuel Abad Ibanez
<font size=1>(40801)</font>
</li>