[Javascript] Calculating large number of different values

Fred Newtz fred at newtz.us
Thu Aug 4 18:41:28 CDT 2005


Thank you for the reply first of all.  I thought I would be all on my own
trying to figure this out.   

An oversimplification is probably what needed to happen in the first place.
Sorry I did not put a code link but I have confidential data in there right
now.  I will move it to a different site and put dummy data in there, if I
need more help.  :-)

The drop downs did serve the purpose to allow the user to change the date to
set future meal menus.  At some point it will also serve to allow them to
look at previous menus also.  However, that is for a later date and time.
There are "potentially" different amounts of children attending for each day
of the week.  So when the date is changed it needs to be able to recalculate
the whole form, not just one row.  Obviously I can't just call the
initialize form function when the user changes the date, so I think I will
have to write a new function to pass the day of the week in there so it will
calculate the values for the proper day?  Or maybe I could just change the
initialize form function to always receive a date as a parameter.  

I really did not expect to receive all this code.  I sure do appreciate it
in a very big way.  I think I will be able to modify what you have here to
suit my needs.  You did for me in ~70 lines of code which took me ~350 lines
of code.  :-)  If I run into another problem I will be sure to post the code
for you to see.

Thanks again,

Fred


-----Original Message-----
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]
On Behalf Of Triche Osborne
Sent: Thursday, August 04, 2005 2:10 PM
To: [JavaScript List]
Subject: Re: [Javascript] Calculating large number of different values

Hi Fred,
	I may be greatly over-simplifying your situation, and if so, I 
apologize, but there were a couple of points on which I was a bit fuzzy 
and you didn't include a link to the problem documents.
	Anyway, I made up a form and script to mimic the behavior you seemed
to 
be describing. Here is a link to my form and a text version of the JS 
driving it:

http://www.triche-osborne.com/testing/fred.html
http://www.triche-osborne.com/testing/fred.txt

There is a departure from your description of note:
	(1) You indicated that the set of dropdowns in your version were
"for 
the current date." Since you did not indicate that they performed any 
function other than obtaining the *current* date, I obtained it from the 
JS Date object instead. If you are concerned that the user's machine 
date will be inaccurate or if they perform some other function such as 
allowing the user to choose a future date for calculating projections, 
this is not appropriate, and you will need to put the dropdown(s) back in.
	If this is not what you were describing, perhaps you could clarify
the 
differences and include a link to the documents so that I/we have a 
better picture.

Triche Osborne

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list