Hi,
I'm trying to put together some jQuery code that will add form elements (input checkboxes) to a form, once the user performs a certain action. Later on the user can then submit this form.
I'm entirely new to jQuery, but I've managed to put together some code that almost works. Here's what I've got:
$("#someDivID").load("myPage.asp?id=x");
myPage.asp generates some form elements, and this all shows up nicely on the page.
However, once I submit (through POST) the form, the new form elements are not actually posted. Here's the form submit function:
$(document).ready(function() {
var options = {};
// bind to the form's submit event
$('#MyFormID').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
});
You'll have to excuse me if I'm totally wrong on this, but I'm guessing it's because the new form elements are generated after the DOM is loaded initially. Do I have to reload the DOM (and if so how?), or should I be doing the whole thing differently?
Best regards, Adam