Slimbox does not like my javascript

31 views
Skip to first unread message

Burden Of Life

unread,
Jan 16, 2012, 6:30:40 PM1/16/12
to Slimbox
Hi !

I just downloaded and tested slimbox 2.04 and it worked well. but as i
included it on a page where i had following code (which also worked
well before !):

<script type="text/javascript">
var valueaoe = 0.0;
var valueitwomd = 0.0;
var valuetshirt = 0.0;
var valuegshirt = 0.0;
var total = 0.0;

$('#aoe').change(function(){
calcSum();
});
$('#itwomd').change(function(){
calcSum();
});
$('#tshirt').change(function(){
calcSum();
});
$('#gshirt').change(function(){
calcSum();
});



function calcSum()
{
valueaoe=parseFloat($('#aoe').val())*8.0;
valueitwomd=parseFloat($('#itwomd').val())*3.0;
valuetshirt=parseFloat($('#tshirt').val())*10.0;
valuegshirt=parseFloat($('#gshirt').val())*10.0;
total = valueaoe + valueitwomd + valuetshirt + valuegshirt;

if(total >= 10.0){
$('#totalprice').val(String(total.toFixed(2))+" €");
$('#shippingfee').val('+0.00 €');
}else{
if(total>0)total = total + 3.50;
$('#totalprice').val(String(total.toFixed(2))+" €");
$('#shippingfee').val('+3.50 €');
}
}
</script>

Slimbox works with and without this script. But my script does only
work without slimbox. This script is for displaying stuff only, and I
don't need advice in security issues! What am I doing wrong?
Hope you can help.

Reply all
Reply to author
Forward
0 new messages