And <button id="test">Test</button> would be replaced by the submit button.

In the first place, after editing the code and changing <div id="output"></div> for <input id="output"/> the fourth field does not receive any content from the 3 fields above, so I have no tested it in a form.

Some idea on how to adapt the code to my project?

If such a thing is possible.

In other case, I would appreciate some other way to do it.

Thanks for your help.

Best regards.

felgall
—
2014-01-23T21:20:08Z —
#2

Merging the fields into a hidden field is relatively easy if the person filling out the form has JavaScript enabled but is not possible if they do not have JavaScript enabled. In that instance you'd have to merge them on the server and so since you have to do that when JavaScript is disabled, why not just do it there for everyone.

Pullo
—
2014-01-26T09:56:34Z —
#3

Hi there,

What felgall says is correct - it's best done on the server, however if you need a JS solution, all you do is this (untested):