Slider: How to use variables in a formule

Hello,

i’m new on javascripting so can someone help me?
I’m using te folowing code for 2 sliders

[code]

Uw leeftijd is: 21jaar

Uw maandelijkse storting is: 50 euro
[/code]

How do I get the variable newValue and newValue2 in a formule.
Something like this:

total= newValue + newVulue2; document.write(total);
The formule needs to change everytheme that 1 variabel changed and not using a button (=calculate).

Can someone help me with this?

grtz,
Ichtus84

total= sld.getValue()*1 + sld2.getValue()*1;