Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-20-2006, 03:13 AM   #1
In Runtime
 
Join Date: Feb 2005
Posts: 110
Default Checkboxes and arrays

How would one use an array to use checkboxes?
could someone give me an example?
__________________

__________________
What version of DOS does UNIX run?
TOWT is offline   Reply With Quote
Old 01-20-2006, 06:52 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: Checkboxes and arrays

Check boxes don't use arrays.
radio boxes are arrays...

for a check box you have a series of boxes, and each can be checked

eg,
<input type=checkbox name=colour1 value=red />red
<input type=checkbox name=colour2 value=green />green
<input type=checkbox name=colour3 value=blue />blue

whilst radio boxes work in arrays where there is an array of elements, but only one value is passed through to the results page.
<input type=radio name=colour value=red />red
<input type=radio name=colour value=green />green
<input type=radio name=colour value=blue />blue
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 01-20-2006, 12:56 PM   #3
In Runtime
 
Join Date: Feb 2005
Posts: 110
Default Re: Checkboxes and arrays

opps .... lol
then if you wanted to use an if statement you would do something like this?

if (color1 = on){
do this
}

is this the correct way to check for the check box?
and by the way what is the integer/number symbol for php/html varibles

example
$ = string
__________________
What version of DOS does UNIX run?
TOWT is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:02 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0