I have a fully working validation in jquery that you can check here
http://jsfiddle.net/5WMff/1321/
Now I've decided to add a possibility of adding new 'rows' to my form that I also would like to validate in the same way as the original row. I already have a working code of adding dynamically fields (see here: http://jsfiddle.net/7yd5o63q/21 ) but I don't know how exactly could I plug in the validation there to the fields that are not yet created. Currently I'm appending another rows by this code:
$("#add_row").click(function(){
$('#listOfCommercials').append('<div id="singleCommercial'+i+'"></div>');
$('#singleCommercial'+i).html('<div class="form-group"> <label>Where do you want to go today?</label> <div class="col-lg-12"> <div class="col-lg-6"> <div class="checkbox"> <label> <input type="checkbox" value="" name="a'+i+'">a</label> </div> <div class="checkbox"> <label> <input type="checkbox" value="" name="b'+i+'">b</label> </div> <div class="checkbox"> <label> <input type="checkbox" value="" name="c'+i+'">c</label> </div> </div> <div class="col-lg-6"> <div class="checkbox"> <label> <input type="checkbox" value="" name="d'+i+'">d</label> </div> <div class="checkbox"> <label> <input type="checkbox" value="" name="e'+i+'">e</label> </div> <div class="checkbox"> <label> <input type="checkbox" value="" name="f'+i+'">f</label> </div></div> </div> </div> <div class="form-group"> <label>When do you want to go?</label> <input type="text" class="form-control" id="datetimepicker'+i+'" name="appearanceDate'+i+'"/> </div> <div class="form-group"> <label>How long should your trip last?</label> <select class="form-control" name="duration'+i+'"> <option>5 days</option> <option>10 days</option> <option>15 days</option> <option>20 days</option> <option>30 days</option> </select> </div>');
i++;
alert(i);
});
so I guess this part has to be modified, but I have no idea how to even start touching it, could you help me with that? Thanks!