|
|
|
|
Like this code?
Show the author your appreciation.
|
|
| |
Here is a small but useful feature i ran accross one day when i was trying to create a small questionaire for a client. The client had a questionaire that asked one main question and have 6-7 different sub questions such as what day would they like to see it happen, what color they feel would be best, etc...
When you create a form you have to come up with the name for each field that you use, if you have multiple fields relating to the same topic, you can use an array for the field names.
What would you like to see us do next?
A Forum Application named forum[]
What is the best color to use? ( Drop Down List Of Colors)
| <select name="forum[]">
<option value="black">Black</option>
<option value="blue">Blue</option>
<option value="orange">Orange</option>
<option value="red">Red</option>
<option value="purple">Purple</option>
<option value="green">Green</option>
<option value="yellow">Yellow</option>
</select> | |
Our Support Desk
1.) How Helpfull Has Our Staff Been? (Drop Down 1-7)
2.) Have Your Problems Been Solved? (Drop Down 1-7)
3.) Quality Of Support (Drop Down 1-7)
These could be implemented by using the following code
| <!-- Drop Down For Support Question #1 -->
<select name="support[]">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<!-- Drop Down For Support Question #2 -->
<select name="support[]">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<!-- Drop Down For Support Question #3 -->
<select name="support[]">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select> | |
When you submit the form and your script takes over, you can use the values as
| $_POST['forum'][0]
$_POST['support'][0]
$_POST['support'][1]
$_POST['support'][2] | |
i hope this short article has solved atleast one persons problem as if it has i have done my job in helping ;) |
|
| Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | How to pass an array from one PHP Script to another via an HTML form Categories : PHP, HTML and PHP, Arrays | | | Print out array key => value in colored HTML Categories : PHP, Arrays, HTML and PHP | | | Newbie Notes #1 - Making a form return to itself Categories : PHP, Beginner Guides, HTML and PHP | | | How to preset a text string in a textarea input field Categories : HTML, HTML and PHP, PHP, Beginner Guides | | | Beginners Array Functions Categories : PHP, Beginner Guides, Arrays | | | dynamic table columns Categories : PHP, HTML and PHP, Arrays, Databases, MySQL | | | Parsing html tags with php. Get an array from this function Categories : PHP, HTML and PHP, Arrays, Tag Extractors | | | Simple PHP Form Field Generator Categories : PHP, Beginner Guides, Form Processing, HTML and PHP | | | Random text quote Categories : PHP, Arrays, Beginner Guides | | | Kewl Date Example Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides | | | mySQL/PHP/search with multientry
form and table output with colored rows Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases | | | Multiple Select box, Select multiple Items from Menu.List box Categories : PHP, HTML and PHP, Beginner Guides | | | Human readable PHP password generator Categories : PHP, Security, Beginner Guides, Arrays | |
|
|
|