jitseschaafsma
06-18-2003, 05:41 AM
Let me explain.
I have made a javascript generates a string that is called in building my HTML page.
This is how a call it :
document.write(addsubtotal([FMP-Field:Cummuren],"-1"))
dependent on the value of [FMP-Field:Cummuren] the function addsubtotal generates a string.
This works great.
For example the string can be "subtotal : " and then followed by a number :
subtotal : 2000
Well, now i want to include a graphic (actually the euro symbol).
subtotal : <euro symbol graphic> 2000
My question is how can i modify my addsubtotal routine to return a composite string (text and a graphic).
thanks
jitse
This is the addsubtotal routine:
function addsubtotal(var1,var2)
{
var retstr=""
if (currweeknr==0)
{
currweeknr=var2
subtotal=var1
genweeknr=1
}
else
{
if (parseInt(var2)==currweeknr)
{ subtotal+=var1
genweeknr=0
}
else
{ retstr="Subtotaal : "+parseFloat(subtotal)
currweeknr=var2
subtotal=var1
genweeknr=1
}
}
return(retstr)
}
I have made a javascript generates a string that is called in building my HTML page.
This is how a call it :
document.write(addsubtotal([FMP-Field:Cummuren],"-1"))
dependent on the value of [FMP-Field:Cummuren] the function addsubtotal generates a string.
This works great.
For example the string can be "subtotal : " and then followed by a number :
subtotal : 2000
Well, now i want to include a graphic (actually the euro symbol).
subtotal : <euro symbol graphic> 2000
My question is how can i modify my addsubtotal routine to return a composite string (text and a graphic).
thanks
jitse
This is the addsubtotal routine:
function addsubtotal(var1,var2)
{
var retstr=""
if (currweeknr==0)
{
currweeknr=var2
subtotal=var1
genweeknr=1
}
else
{
if (parseInt(var2)==currweeknr)
{ subtotal+=var1
genweeknr=0
}
else
{ retstr="Subtotaal : "+parseFloat(subtotal)
currweeknr=var2
subtotal=var1
genweeknr=1
}
}
return(retstr)
}