Fairly easy to do in theory but can get complicated in the long term....
For instance, what happens if someone changes the number of books halfway through.
Does this mean that all excess book fields get deleted or only those which are empty ?.
You may want to look at
viewtopic.php?t=13891
Personally I use a function
Code: Select all
function changeElemContent(elementId,content) {
if(document.implementation &&
document.implementation.hasFeature &&
document.implementation.hasFeature('Range','2.0')) {
// Can use ranges (Netscape 6+)
node = document.getElementById(elementId);
var newRange = document.createRange();
newRange.selectNodeContents(node);
newRange.deleteContents();
var newHTML = newRange.createContextualFragment(content);
node.appendChild(newHTML);
} else {
if(document.getElementById) {
// Process using inner HTML (Explorer 5&6)
document.getElementById(elementId).innerHTML=content;
} else {
// Other generic tries to match other browsers. Do not always work (e.g Netscape 4)
if (document.all) {
document.allїelementId].innerHTML=content;
} else {
if(document.layers) {
with(document.layersїelementId].document) {
open();
write(content);
close();
}
}
}
}
}
}
but that might add more complexity than you need. (I'll let you figure out what it does

)