By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,146 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,146 IT Pros & Developers. It's quick & easy.

HELP with PHP and javascript in a grid matrix

P: n/a
Hello,
I am trying to develop an online application that utilzes a grid to save our sales people weekly
productivty.

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

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.

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

Any ideas how I can started on this
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Gleep" <Gl***@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


Jul 17 '05 #2

P: n/a
I noticed that Message-ID: <76********************************@4ax.com>
from Gleep contained the following:
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.

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 http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

P: n/a
Gleep <Gl***@Gleep.com> wrote in
news:76********************************@4ax.com:
Hello,
I am trying to develop an online application that utilzes a grid to
save our sales people weekly productivty.

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

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.


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
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.