NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need ideas on implementing this feature

Brent Baisley brent at landover.com
Wed Sep 4 11:41:40 EDT 2002


I assume you have Javascript changing a popup menu to indicate the valid 
measurements. For those ingredients that can have a "custom" 
measurement, I would add "Custom" as the last option in the popup. You 
can than add an OnChange handler to that popup which checks if the 
"Custom" option was selected. If custom was specified, you can generated 
a "popup" window that will allow them to enter the custom value. Using a 
popup window would allow you to use php to query for only the valid 
items, rather than downloading all of the possible options when perhaps 
none of them would be used.

Back on the main page you can have a hidden field that gets updated from 
the popup window. The hidden field would contain the custom value 
specified. The problem here is to actually display the custom value on 
the main page. Perhaps DHTML or CSS could solve this problem.

This scenario mixes the server-side and client-side techniques, using 
the whichever is best for the situation.

On Wednesday, September 4, 2002, at 11:02 AM, Peter Simard wrote:

> Here's the scenario:
>
> In selecting an ingredient to include in a recipe the user makes the
> choice, then chooses the unit of measure ( Hamburger 3 ounce ), however,
> some ingredients have a custom conversion unit available to them which 
> is
> a user defined unit of measure,  and other ingredients don't.
>
> Problem:  When loading the select boxes with ingredients, the user has
> yet to choose an ingredient, so determining if an ingredient has a 
> custom
> conversion associated with it is unknown.
>
> My thought here is to write/load a JavaScript array with the all the
> custom conversions and their associated ingredients.  When an ingredient
> is selected a function determines if that ingredient has a custom
> conversion associated with it, if yes, then the unit of measures
> available to that ingredient in the next select box are updated to
> reflect the fact that the selected ingredient has custom conversion
> munits to choose from in addition to the standard measurements.
>
> So mixing the JS and the PHP, is this a sound method, or would one
> recommend doing it all server-side?  If the recommendation is 
> server-side
> I envision lots of page updates in the process.
>
> FYI: I know my client will have JavaScript enabled.
>
> Any thoughts?
>
> Thanks, Pete
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577




More information about the talk mailing list