Forum Moderators: open

Message Too Old, No Replies

Javascript-based real-time calculations

         

mr_nabo

3:20 pm on Dec 7, 2007 (gmt 0)

10+ Year Member



Hi,

Apologies for the total lameness of this first post in this part of the forums. I need to get involved in writing javascript as I realise it's absolutely essential in building todays websites.

My first question is: is there a book (along the lines of PHP and MySQL Development by Welling & Thomson) that covers real-life executions of javascript?

My second question is whether there's a good tutorial on writing javascript that will calculate a total in real-time (i.e. you select a value from the drop-down box of a form and a total is created in a dynamic text-field)?

I'd need to apply discounts on figures such that the more you order (for example) the bigger the discount, but only up to a certain point after which the rate is standard - I realise this will demand I conjure up some elementary maths skills again.

Any ideas?

Thanks

lavazza

8:46 pm on Dec 8, 2007 (gmt 0)

10+ Year Member



I think you'll need to get your head around incrementing global and local vars via functions that are triggered by onClick, onBlur and/or onChange events

Google might help:

Results 1 - 10 of about 13,400 for javascript global local vars increment
[google.com]

Perhaps Sams Teach Yourself JavaScript in 24 Hours might help too, particularly Hour 4: Using Functions and Variables

There's (at least) one online version and hard copies are widely available