Client wants to email a form that has been populated by a user. The form needs to keep its structor and be sent to the client like it is
My Original Solution:
Take all of the $_POST data and recreate the form on a "thank_you.php" page. Then take that data and email it out. This solutions works, however, the forms have 75 to 80 fields! And I am getting tired of $_POST['form_field']; in every freaking input, and the if statements on the checkboxes, well you know where I am going here. Basically my solution does work, but there has got to be a faster way.
What I would like to do is create some AJAX that passes the innerHTML of a form to a PHP page, and then just email the variable that contains all the data. My first problem was that I could get the innerHTML of a div item (which contains the form), but of course it doesn't retain any server side changes, like checked check boxes, filled in input boxes and such. I mad a simple moc up of what I am trying to do attached. Basically, if I can get the attached code to pass the checked items and such, I can make the AJAX issue work. HELP!!!
filled_form = document.getElementById("inner").innerHTML
document.getElementById("inner2").innerHTML = filled_form
<input type="checkbox" name="one" />
<input type="checkbox" name="two" />
<input type="checkbox" name="three" /><br />
<input type="button" onclick="formsub();" value="Submit" />
<div id="inner2" style="border:1px solid #000000;">