I have a form with a lot of input text and check boxes. User are allowed to edit it after post submission. The data from the form are stored in the database. For me to allow the user to edit, I would have to retrieve the form value from the database and populate the form.
There are at least 30 inputs and if I use PHP to compare each and everyone, the code is very unclean and I am sure there is another better way to do it.
I was thinking of storing the entire form's html in the database and reload it back when user hits the edit function.
Question 1 How can I save the entire div#save-div's html upon submission? How do I access $('#sav-div').html in the php post-submit page?
Example Code
<form type="submit" <form name="post_item" id="post_item" method="POST" action="post_form.php">
<div id="save-div">
<input type="text" id="1" />
.
.
.
//many input text and check boxes
</div>
</form>
Question 2 Do I un-escape/escape the html code when I retrieved it from database when my PHP page loads? Can anyone write a simple examples?