G

#### GTN170777

think I'm done for now,...

Is it possible to insert recordset data in a javascript, for instance I have

a javascript code that calculates the total price, depending on number of

units, currently what the code does is set the price like so -

if qty 1 then Â£99+VAT

if qty equall to or greater than 2 and equall to or less than 9 then price =

70+VAT calculate total qty by price = total price + VAT

if qty equall to or greater than 10 and equall to or less than 19 then price

= 55+VAT calculate total qty by price = total price + VAT

if qty equall to or greater thar 20 and equall to or less than 50 then price

= 35+VAT calculate total qty by price = total price + VAT

See below

if((numQty >= 1) && (numQty <=

1)){document.getElementById('divPrice').innerHTML = 'Â£' + '99.00' + ' + VAT';

document.getElementById('maindivPrice').innerHTML = 'Â£' + Math.round(100*(99

* numQty))/100 + ' + VAT';

}

else if((numQty >= 2) && (numQty <=

9)){document.getElementById('divPrice').innerHTML = 'Â£' + '70.00' + ' + VAT';

document.getElementById('maindivPrice').innerHTML = 'Â£' + Math.round(100*(70

* numQty))/100 + ' + VAT';

}

else if((numQty >= 10) && (numQty <=

19)){document.getElementById('divPrice').innerHTML = 'Â£' + '55.00' + ' + VAT';

document.getElementById('maindivPrice').innerHTML = 'Â£' + Math.round(100*(55

* numQty))/100 + ' + VAT';

}

else if((numQty >= 20) && (numQty <=

50)){document.getElementById('divPrice').innerHTML = 'Â£' + '35.00' + ' + VAT';

document.getElementById('maindivPrice').innerHTML = 'Â£' + Math.round(100*(35

* numQty))/100 + ' + VAT';

}

What I would like to do is very similar, however I have 1 price which is

variable and called from a recordset, so for instance lets call the price xx

So my javascript would need to be something like this -

If qty <= 10 price = xx multipled by qty = Total Price

If qty >=11 but <=20 (xx /.9) multipled by qty = Total Price

If qty >=21but <=40(xx /.75) multipled by qty = Total Price

If qty >=41but <=50(xx /.6) multipled by qty = Total Price

of course the code above mine also has this -

innerHTML = 'Â£' + '70.00' + ' + VAT' etc, so again I would need to have

something like innerHTML = 'Â£' + 'qty <= 10 price = xx multipled by qty =

Total Price/ qty..

Does anyone have any ideas?

can this be done?

Thanks Gurus