Click to See Complete Forum and Search --> : sending id to js function


kipa
08-31-2004, 11:11 PM
Hi all i am using this function for open/close folder

function NodeProcessing(divNum,TmpId){

if (divNum == 0)
{
var txt = document.getElementById('a2').innerHTML


document.getElementById('a2').innerHTML = (txt=='Show All Sub') ? "Hide All Sub" : "Show All Sub"
}

and when i am calling this function by:

<a href="#" onclick="NodeProcessingYanuv(0,{generate-id(.)})" id="a2">Show All Sub</a>

this static code works fine but when ever i try to change the code to a dynamic way like that :

function NodeProcessingYanuv(divNum,TmpId){
if (divNum == 0)
{
var txt = document.getElementById(TmpId).innerHTML
document.getElementById(TmpId).innerHTML = (txt=='Show All Sub') ? "Hide All Sub" : "Show All Sub"
}

and i an calling this function by:

<a href="#" onclick="NodeProcessingYanuv(0,{generate-id(.)})" id="{generate-id(.)}">Show All Sub</a>

It is not working, and the debbuger say that an object is needed

way the id="{generate-id(.)}" dont work like id="a0"> ?

can anyone help please ?

crh3675
09-08-2004, 07:53 AM
Are you trying to simply display the page in a browser? generate-id() is an XSLT function, not an XML function.