General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 27th, 2003, 04:47 PM
nestorvaldez nestorvaldez is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 40 nestorvaldez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 21 sec
Reputation Power: 7
I want to Control Various Checkbox

Hi, every body, thanks, for your help...

Right now I need to know How May Control some checkboxes...

I have a table with 1 Row and 1 Column, (one table field). And I have 38 checkbox in this table, The checkboxes are enumarated from 1 to 38. and I want to know how can I control that the User only could check six checkbox (number). Ex, If I have checked six checkbox, and I try to check the 7th, it doesn't let me check it, and show a warning message. and I want to control that the user couldn't submit this without to complete the six number, this mean that I can't submit it without to complete the six numbers.
I want to do this with PHP.

I'm confused because, when I'm programming in another enviroment i can control any event of any objetc.

I'm not so clear about php work about it.

Reply With Quote
  #2  
Old September 27th, 2003, 06:35 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
im not too sure about this but you could try using if statements or functions

Reply With Quote
  #3  
Old September 27th, 2003, 06:40 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
PHP is a server side language and thus cannot control what a user does on the client side.

What you are asking for is immediate event control which can only be done client-side. You need a Javascript, Jscript, or VBScript solution.

I'd advise you to go with Javascript. In Javascript you can control any element by it's id (name). If you were to loop through the elements on a page and count the ones that are checked you could easily flag (alert dialog) the user to the error.

As far as the submit button not working, you can have the submit button default to being disabled and enable after counting that six checkboxes are checked.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #4  
Old September 29th, 2003, 02:25 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Code that may help

Attached is code that may help out your situation.
Attached Files
File Type: zip checkbox_constraint.zip (1.9 KB, 275 views)

Reply With Quote
  #5  
Old September 29th, 2003, 07:49 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
This was cross-posted at http://www.devarticles.com/forum/sh...=&threadid=5137 also. Please quit cross-posting.

Reply With Quote
Closed Thread

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > I want to Control Various Checkbox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT