Re: HELP with PHP and javascript in a grid matrix

From: Dan Stumpus (dstumpus_NOSP_at_mindspring.com)
Date: 02/14/05


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



Relevant Pages

  • Re: HELP with PHP and javascript in a grid matrix
    ... > way to have an identifier ... I'm not an expert, and the PHP princes may have a more elegant way, but I've ... Create a separate hidden field for each cell which contains the ... When the form is submitted the values of the hidden fields will be sent up ...
    (alt.php)
  • Re: Selection Combined with Search
    ... Searching for the entire value in the cell wouldn't be required if you ... changed xlWhole to xlPart ... The identifier begins with a period. ... If rngStart Is Nothing Then Exit Sub ...
    (microsoft.public.excel.programming)
  • Re: Trying to Delete Hidden Fields?
    ... I placed my cursor in a blank cell. ... what can I do and why can I still tab to ... I'd like to get rid of the hidden fields so ...
    (microsoft.public.word.tables)
  • Re: Excel Calcs in Access
    ... certain that the query will find the correct "cell above" (i.e. the ... first calc that needs to be done in order to create the first part of the ... section identifier which is in the same column as the "D"s. ... I need to take out the following characters from column C via a find all ...
    (microsoft.public.access.modulesdaovba)
  • Re: Trying to Delete Hidden Fields?
    ... If the paragraph formatting in a cell is set to a negative left and/or right ... and that would result in the Tab problems in the unprotected as well as the ... I placed my cursor in a blank cell. ... I'd like to get rid of the hidden fields so ...
    (microsoft.public.word.tables)