|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
im not too sure about this but you could try using if statements or functions
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
Code that may help
Attached is code that may help out your situation.
|
|
#5
|
||||
|
||||
|
This was cross-posted at http://www.devarticles.com/forum/sh...=&threadid=5137 also. Please quit cross-posting.
|
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > I want to Control Various Checkbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|