I have a form that is dynamically generated, and has dynamically generated id\'s (and potentially classes). The forms are the same but they have the related id tacked on to
$("input[id^='id_airline_for_']").each(function() {
var id = parseInt(this.id.replace("id_airline_for_", ""), 10);
var airline = $("#id_airline_for_" + id);
var flightNumber = $("#id_flight_number_for_" + id);
// do stuff with airline and flightNumber s
});