From the course: Learning PHP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Handing multiple-choice elements

Handing multiple-choice elements - PHP Tutorial

From the course: Learning PHP

Start my 1-month free trial

Handing multiple-choice elements

- Each of the elements and most of the elements that you've seen on the forums so far have only had one value associated with them. So, the input was pretty easy to grab, but what about elements that allow multiple values like checkbox and selects? Let's take a look at how they work. First of all, you could see here that we've added the checkboxes for what topics are you interested in? We've named them topics, and we have a multi-select box for movies. What's your favorite movie or movies? And it's all of the 'Star Wars' movies. And we've named that movie. So, let's see what happens if we just throw this form through the processor we previously used, which was for a reminder, for each loop that assigns each key value pair as name and value. So we'll go ahead and fill this out. I'll select PHP and WordPress, and then I'll select Star Wars IV and V, and I liked VII. And then I'll add the message, "Hello There!"…

Contents