chanveil Posted January 27, 2011 Share Posted January 27, 2011 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. Link to comment Share on other sites More sharing options...
thescientist Posted January 27, 2011 Share Posted January 27, 2011 could you show us your code? Link to comment Share on other sites More sharing options...
ShadowMage Posted January 27, 2011 Share Posted January 27, 2011 FYI when you click on a letter, it calls (ajax) a .php script that generates the table based on the MySQL database.So the page never refreshes then? If that is the case you should be able to just have a global variable that gets updated when the user adds a new food to their list.BTW, it's JavaScript not Java. (The two are entirely different languages) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.