Happy Coding
We will create form with type select multiple input:
<form method="post" action="process.php" >
Firstname: <input type="text" name="firstname" />
<br />
Lastname: <input type="text" name="lastname" />
<br />
Description: <textarea name="description" rows="10" cols="50"></textarea>
<br />
Add input type select with:
- It name in array postfix []
- Set attribute multiple
- Set attribute size; default size='4' (options)
Programming Language (multi): (hold ctrl + click item)
<select name="languages[]" multiple size="5" >
<option value="c" >C</option>
<option value="c++" >C++</option>
<option value="java" >Java</option>
<option value="javascript" >Javascript</option>
<option value="php" selected >PHP</option>
</select>
<br />
<hr />
<input type="submit" name="submit" value="Submit" />
</form>
And, the process:
echo "<pre>";
var_dump($_POST);
Top comments (0)