I have the following situation:
<table><tr><td width="50">
<select name="angle">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</td><td>
<input type="text" name="what" value="" />
</td></tr></table>
<a href="">+ Add Row</a>
So, the plan is that when the user first comes to page, they will see 1 row. They will enter the data and click "add row" multiple times to enter all of their data. At a later date, they should be able to come back and edit or remove any of the rows.
My question/problem is: in the javascript, I need to have the full HTML to generate each of the rows or perform an AJAX request to get the new row from the server. On the server I need to have the HTML to generate the rows when the users comes back to edit or do I pass the values using a json array.
I'm wondering what you would do as I'm trying to avoid having the HTML in 2 places. Would you put all the HTML in JS? Or would you put all of the HTML on the server (PHP) and call with AJAX? Or would you just have the HTML in 2 places? (BTW, the case I'm working which has 5 columns and a lot more HMTL.)
I am using: PHP + MySQL + jQuery