See, working without JavaScript severely restrict your abilities: you have to rely upon the standard HTTP request/response cycle. In other words, you have to rebuild a new page (adding some input field) and send this new page each time - there's no workarounds.
Here's how I would implement it:
<form action="/path/to/action" method="post">
<input name="param_a" />
<input name="param_b" />
<button type="submit" name="next_input" value="param_c">Add a field</button>
<button type="submit" name="submit">Submit your form</button>
</form>
... then within the server-side code I'd just check whether next_input
param is sent or not. If sent, its value will be used to get the control which is to be added - and give the corresponding value (param_d
, for example) to the next next_input
.
UPDATE: but I just can't help wondering is this really necessary. Usually we design for 'No JS' cases when these pages are typical landing pages (scanned by search robots). Thinking about some users that will go to your page without JS enabled, yet willing to use it with all pretty things enabled... well, it's not very cost-effective, to say the least. )