This code prints about 15 rows of data with this select box near each row. I need to capture user's selected value for each row to send it of to the next function. I'm receiving this error: Uncaught TypeError: Object # has no method 'val'. Is there a better way to achieve this?
count = 1;
$.each(data, function(index, element) {
$('<div class="hd_field">Payment Format: <select name="Payment_Format" id="Payment' + count + '" class="Payment_Format"><option value="CTX" selected="selected">Company to Company</option><option value="PPD">Company to Person</option></select><div id ="Selected_Format' + count + '"></div></div>').appendTo(newDiv3);
$('select#Payment' + count).change(function() {
alert(this.val());
PaymentFormat = $(this).val();
element.PmtRec.PmtFormat = PaymentFormat;
$('#Selected_Format' + count).text(PaymentFormat);
});
console.log(data);
count = count + 1;
});
datavariable an array?