Re: HELP with PHP and javascript in a grid matrix
From: Dan Stumpus (dstumpus_NOSP_at_mindspring.com)
Date: 02/14/05
- Next message: Westcoast Sheri: "BB code help"
- Previous message: Gleep: "HELP with PHP and javascript in a grid matrix"
- In reply to: Gleep: "HELP with PHP and javascript in a grid matrix"
- Next in thread: Geoff Berrow: "Re: HELP with PHP and javascript in a grid matrix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 14 Feb 2005 04:42:48 GMT
"Gleep" <Gleep@Gleep.com> wrote
> In the gridl, we want the cells to include an image that has three color
> states that are clickable.
> For example 1 click is green 2nd click is red - 3rd click is blue each
> color represents a dollar value.
> I wrote up a simple javascrip that rotates three images. I probably need a
> way to have an identifier
> on each image in each cell so when I submit the entire form I know what
> state the Image color was last.
----------
I'm not an expert, and the PHP princes may have a more elegant way, but I've
done this kind of thing before. I'd:
1. Create a separate hidden field for each cell which contains the
color-state.
2. when your onClick handler switches the color, have it
set this.form.[hiddenFieldNameForTheCell].value to the color state value
(e.g., 1,2,3 or whatever).
When the form is submitted the values of the hidden fields will be sent up
in $_POST with all the others.
In the JSP world, you can return an array of values when a form with tabular
data was submitted. That would be cleaner than a jillion hidden fields, but
I don't know if that's possible in PHP.
-- Dan
- Next message: Westcoast Sheri: "BB code help"
- Previous message: Gleep: "HELP with PHP and javascript in a grid matrix"
- In reply to: Gleep: "HELP with PHP and javascript in a grid matrix"
- Next in thread: Geoff Berrow: "Re: HELP with PHP and javascript in a grid matrix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|