473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

HELP with PHP and javascript in a grid matrix

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
3 1889
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: greenflame | last post by:
I am trying to make a matrix object. I have given it some properites. I am trying to add a method. When I call the method by Test.showDims(...) I want to only enter one input, that is the method by...
10
by: Nevets Steprock | last post by:
I'm writing a web program where one of the sections is supposed to output a correlation matrix. The typical correlation matrix looks like this: ..23 ..34 .54 ..76 .44 .28 ..02 .77 ...
3
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way...
3
by: ntexchange05 | last post by:
I am trying to learn asp.net and build a site and i am using web matrix and vb.net. I have installed the MSDE on my windows xp pro, i am using the book calledbeginning dynamic websites with...
83
by: deppy_3 | last post by:
Hi.I am started learning Programm language C before some time.I am trying to make a programm about a very simple "sell shop".This programm hasn't got any compile problem but when i run it i face...
13
by: Guardiano del Faro | last post by:
Hello!! i'm just a dummie in C/C++ and i need you help for solving my little problem. I have to create a 3D grid of points. Each point has the 3 coordinates and a boolean value. (I made a...
2
by: =?ISO-8859-1?Q?Marco_K=F6rner?= | last post by:
Hello, I'm working on mapping the car's environment by updating an occupancy grid. An occupancy grid dicretizes the 3D space in small grid elements (voxels). A grid element contains informations...
3
by: okcomputer24 | last post by:
I am wanting to print a matrix grid which is derived from a list of lists. The grid should look as follows: Col 0 Col 1 Col 2 Row 0 1 2 3 Row 1 4 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.