SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Question...
-
Oct 20, 2000, 07:33 #1
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Here is what I need to do.
The user has multiple pages to fill out. All of the info he fills in is put into a database (MySQL). Most of the input types are check boxes. The administrator then needs to see the results of the users filling in the boxes.
However, if certain fields are left blank they need to be turned red when the admin checks out all of the applications.
So if a user filled in all of the check boxes except for CPR when the admin looked to see if they had CPR experience the answer would be NO, and the No would be colored red.
Thanks,ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Oct 20, 2000, 08:03 #2
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thats not difficult, but one thing you have to remember is when a checkbox is not checked a nullvalue does not get sent to the server. So you have set set a default value for all your checkboxes.
Then just do If box = nullvalue then color = red sort of thing.
Chris
-
Oct 20, 2000, 17:55 #3
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Ok... But won't that take a ton of if..else.. statements? I mean I have over 400 fields
Another question,
On the main user screen I need to display 6 images that are links to each of the 6 forms. The links will have 2 images (one for when the form is complete and one if it is not). I know I will need to do a query to see if those fields that are in that form are filled but is there a more efficient way to do it?ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Oct 21, 2000, 00:56 #4
- Join Date
- Apr 2000
- Posts
- 1,483
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could store all of the checkbox names in the database, then loop through them and check whether or not they are checked. There is a similar example in Kevin Yank's PHP tutorial on http://www.webmasterbase.com - check out part 6. It needs to be adapted quite a bit, but is relatively similar to your example.
Bookmarks