This post is a follow up with previous post, the application is running on jQuery 1.4 but advice from any version is appreciated:
Current problem is even use
rowTemplate = j('.form-denomination:first-child').clone();
and
var newRow = rowTemplate.clone().attr('id', newRowId);
I can see newRow
still holds the old data in first child from the list using firebug, no matter what I select from web page.
For example, if the first child for the list to be cloned is node[0]
<select id="_denominations[0].id.denominationId" class="removableDenom" name="denominations[0].id.denominationId">
<option value="100">100</option>
<option value="1000">1000</option>
<option value="10000">10000</option>
<option value="500">500</option>
<option value="5000">5000</option>
<option value="50000" selected="selected">50000</option>
</select>
And I add a new row after node[2], it would look like
<select id="_denominations[3].id.denominationId" class="removableDenom" name="denominations[3].id.denominationId">
<option value="100">100</option>
<option value="1000">1000</option>
<option value="10000">10000</option>
<option value="500">500</option>
<option value="5000">5000</option>
<option value="50000" selected="selected">50000</option>
</select>
See it is still showing 50000 as selection for the dropdown box, even it shows 100 on the webpage So what's going on?