My problem is that I don\'t know how to show the innerhtml of my form.
The form is like a survey form and once you clicked the submit button, all the contents I had
var maincontent = document.getElementById("content").innerHTML;
maincontent = "" + first;
On the second line you're overwriting the variable, not setting the .innerHTML. This is what you want:
var maincontent = document.getElementById("content");
maincontent.innerHTML = "" + first;
Also, you must make sure the elements with ids of "first" "middle" and "last" actually exist, or this might cause a TypeError.