HELP with PHP and javascript in a grid matrix

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to develop an online application that utilzes a grid to save our
sales people weekly

We have a grid listing the days of the week going across the top    Sunday -
Along the left side is hours of the day broken up in half hour increments. 16

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

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

We want our sales people to click the various grid images to the correct  colors
by each half hour.
Then once the week is coded I need to save the grid contents (probably a large
array) into our

Any ideas how I can started on this

Re: HELP with PHP and javascript in a grid matrix

Quoted text here. Click to load it


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
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

Re: HELP with PHP and javascript in a grid matrix

from Gleep contained the following:

Quoted text here. Click to load it
You have kind of just re-invented the radio button...
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs /

Re: HELP with PHP and javascript in a grid matrix

Quoted text here. Click to load it

You need at least four states - the fourth for "no dollars",
on vacation, sick, etc. Default all cells to "no dollars",
use radio buttons, and use javascript to do client-side
validation, such as confirming that they really didn't generate
any sales on Tuesday afternoon(e.g. when they were sick).

Dave Patton
Canadian Coordinator, Degree Confluence Project /
My website: /

Site Timeline