0% found this document useful (0 votes)
39 views

Web2 Prelim Checkbox, Select and Array

Checkboxes and drop-down lists in HTML forms can capture multiple selected values as arrays, which PHP can then display. Checkboxes are used for options like pets owned where multiple can be selected, and drop-down lists similarly allow choosing multiple owned pet types. Example code demonstrates creating forms with checkboxes and drop-down lists for pet selection, and using PHP to display the selected pets.

Uploaded by

Boni Carrera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Web2 Prelim Checkbox, Select and Array

Checkboxes and drop-down lists in HTML forms can capture multiple selected values as arrays, which PHP can then display. Checkboxes are used for options like pets owned where multiple can be selected, and drop-down lists similarly allow choosing multiple owned pet types. Example code demonstrates creating forms with checkboxes and drop-down lists for pet selection, and using PHP to display the selected pets.

Uploaded by

Boni Carrera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Checkboxes, Drop-down list (select) and Arrays

1. One frequent application of an array is when you need to capture the values of checkboxes from an
HTML form. Checkboxes are used when multiple values can be selected. For instance, if you asked
someone to list the types of pets they own. It is likely that an individual will own no pets, one pet,
two pets, etc. If you wanted to get all the pets an individual owns, you could use a set of checkboxes.

Create a form that will satisfy the above-mentioned requirements.

Create a PHP program that will display the pets selected by the user.

2. Another application of an array is when you need to capture the values of drop-down list (<select>
tag) from an HTML form. Drop-down lists are used when multiple values can be selected. For
instance, if you asked someone to choose the types of pets they own. It is likely that an individual
will own no pets, one pet, two pets, etc.

Create a form that will satisfy the above-mentioned requirements.

Create a PHP program that will display the pets selected by the user.

You might also like