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

<form action="" method="post">
<p>You can enter your subjects as many times as possible</p>

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

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


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.