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!

----->

Member Avatar for diafol

Yes you need javascript.
Your best bet (IMO) is to output form fields to rows in a table. Then you can press a big Update button to update a DB via PHP - either through normal form submission or via ajax.

You may find an editable table easier, where a cell can be turned into a dropdown or a textbox on click. And you could add new editable rows too. This is not a trivial bit of coding though, but not that difficult either. However, Daniweb is not a free coding service. Have a search for some scripts, have a play and come back to us with questions or problems.

Thanks Diafol. Your assistance is greatly appreciated! Will be hoping to hear again from you incase i have any question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.