SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Feb 4, 2001, 21:32 #1
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have a select form field that allows you to choose multiple options (as used with the SET data type in mySQL). Here is my form:
Code:Format(s): <select name="format_type" size="3" multiple> <option value="Compact Disc">Compact Disc <option value="Cassette">Cassette <option value="Vinyl">Vinyl</select>
What am I doing wrong here? Is the form correct?
-
Feb 4, 2001, 22:01 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you need to make the name of the select an array so fo your code:
<select name="format_type[]" size="3" multiple>
<option value="Compact Disc">Compact Disc
<option value="Cassette">Cassette
<option value="Vinyl">Vinyl</select>
No the script that processes this can access it as:
print "Your selections: <br>";
foreach($format_type as $type) {
print $type."<br>";
}
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Feb 4, 2001, 22:56 #3
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks, that worked.
Bookmarks