• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Javascript carry the variable over to next page

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am building a calorie counter/calculator and I am stuck on carrying the variable over so that it accumulates total value (java/ajax).

So if you click on the letter A you will get a list of foods in the A group and as you modify the form you will increase your caloric value. If you choose a new food group the value is zero'd out.

I need the counter to accumulate all choices from all food options. any ideas?

I am a PHP coder and very very new to java and ajax.

FYI when you click on a letter, it calls (ajax) a .php script that generates the table based on the MySQL database.
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can store it in cookies or on the server.

When more browsers support HTML 5 concepts, this will be easier, but for now JavaScript cannot maintain values across requests on its own.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic