NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need ideas on implementing this feature

Jim Hendricks jim at bizcomputinginc.com
Wed Sep 4 12:01:01 EDT 2002


A method I use which minimizes the JavaScript as well as minimizes the
required page loads is to use an iframe for the conversion info.  When the
user chooses the ingredient it refreshes the iframe with the selected
ingredient.  The iframe can then hold the info & choices allowable for that
ingredient.  You need javascript to trigger the iframe refresh, and
javascript to grab user choices from the iframe and put them into your base
form as part of submit.

Jim

----- Original Message -----
From: "Bill Patterson" <patterson at computer.org>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Wednesday, September 04, 2002 11:24 AM
Subject: Re: [nycphp-talk] Need ideas on implementing this feature


> It seems that the trade off to consider is whether the conversion
information
> is so voluminous to download that it would cause more problems than the
> multiple page updates if you use PHP for the conversion information.  If
it
> is relatively simple and easily managed in JavaScript, I'd go that way.
>
> Bill
>
> 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
>
>
>
>
>





More information about the talk mailing list