If I have a page with a form (imagine simple using only TextBoxes and a submit button) and I want to allow the user to dynamically add additional text fields to the form via javascript, what is the best way to handle requesting a server?
Example: I have a page that looks like this:
<input type = "text" id = "control1" name = "control1" /> <input type = "text" id = "control2" name = "control2" /> <input type = "text" id = "control3" name = "control3" /> <input type = "submit" />
The user runs Javascript, and the page turns out as:
<input type = "text" id = "control1" name = "control1" /> <input type = "text" id = "control2" name = "control2" /> <input type = "text" id = "control3" name = "control3" /> <input type = "text" id = "control4" name = "control4" /> <input type = "text" id = "control5" name = "control5" /> <input type = "submit" />
What is the best way to deal with this situation or, more generally, to work with dynamically generated inputs both on the client side and on the server side (for example, how to generate them on the server side, starting, say, with some data taken from the database data)?
pistacchio
source share