Jump to content
Larry Ullman's Book Forums

Option Of (1)Selecting Then Uploading Data And Then To Do..(1) Many Times


Recommended Posts

Hello! Please I would want to be able allow users select  options from a list of selections as many times as possible using php, how do i achieve that? Below is a form for better description of what i desire to do

 

<html><body>

<form action="" method="post">

<p>You can enter your subjects as many times as possible</p>

<select>

<option>English</option>

<option>Mathematics</option>

<option>Physics</option>

<option>Chemistry</option>

<option>Biology</option>

</select>

<select>

<option>A</option>

<option>B</option>

<option>C</option>

</select>

<select>

<option>2012</option>

<option>2011</option>

<option>2010</option>

</select>

 

<Input type="button" value="enter">

</form>

</body>

</html>

 

--------------------end

Supposing the user want to enter 5 subjects with their respective grades and year, how do you make the html and php do this jointly or would one require Javascript to do this? Please I need your assistance!

Link to comment
Share on other sites

To allow a person to select multiple things in one SELECT menu, you just add `multiple` to the opening tag. That being said, I think you need to rethink your logic in your HTML. It sounds like they need to select: class, grade, year, all tied together. But they can select any number of those entries. So you actually will need X number of class, grade, and year select menus, all named in such a way that they can be associated. 

 

You can use PHP to generate the right HTML (with a loop, this will be easier), but you'll want to make sure you get your HTML right before moving onto the PHP that handles the form's submission.

Link to comment
Share on other sites

 Share

×
×
  • Create New...