Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Calculations from Form Inputs?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36887
    Andy Howells
    Participant

    Hi all,

    I’m putting together a calculator for a customer that is based on 3 user inputs that output a bunch of numbers. It needs to have multiplication, subtraction, division and addition all in one form as the output fields relate to eachother.

    I’m looking to get it setup to populate in real time as the user submits information.

    Does anyone have any scripts/ideas where to begin – I’ve obviously googled but it’s a jungle out there so some straight advice would be awesome.

    #105502
    bezucat
    Participant

    Hi,

    Thanks to all involved in this thread, this is just what I’m after but I need to ask the following:

    How do I assign a custom value to each input title/section/field?

    I need to calculate the total (add together, as in the example code), but each input item will have a different value, not 1 – i.e some will be 1, others will be 2.5 or 3, dependent on field/question being answered in the form.

    So how can I add this predetermined custom value to the existing code, so that it will tally up the total answered fields at the end?

    Thanks

    #182197
    profipix
    Participant

    Great discussion and just what I was looking for!
    Andy, would you show the snippet of the code on how you’re using .toFixed(2)?
    I need to use that too and I can’t figure it out.. Thanks a bunch!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.