I'm a jQuery newbie, so be gentle! I have a loop that outputs extra fields in a form (based on value). All good so far. However, in my extra fields is a date of birth set, which I normally create days/years options using a loop. My question is, how do I create this inner loop inside my outer loop? Here's the basic outline so far:
function addRow() {
for(var i=1;i<numPax;i++)
{
$('#additionalPax').append("My additional fields HTML in here.");
}
}
Now what I want to do is add a loop in my append string to create my day select for example. This isn't right, but something like this:
function addRow() {
for(var i=1;i<numPax;i++)
{
$('#additionalPax').append("<select name='dobDay'><option selected='selected' value='1'>1</option>"+for(var d=2;d<32;d++){+"<option value="+(d)+">"+(d)+"</option>"+}+"</select>");
}
}
Any help very much appreciated.