Hi,

I have a form with a few input fields. I then have jQuery append a few checkbox input fields. I can see the checkboxes appear and behave fine. Now, when I click on the button to submit my form, all input fields are posted to my php controller except for those which have been added by jQuery.

Here is how I add a checkbox input field:
Code:
        $('#checkboxes').append(
          $(document.createElement("div")).html(firstname + ' ' + lastname).append(
            $(document.createElement("input")).attr('name', 'subscriptionId_' + elearningSubscriptionId).attr('value', 1).attr('type', 'checkbox').attr('checked', true)
          )
        )
The form lookis like:
Code:
<form action='/dev/php/learnintouch/www/learnintouch.com/engine/modules/elearning/assignment/add.php' method='post' name='edit' id='edit'  target='_self'>
The checkboxes elements is sitting within the form opening and closing tags and looks like:
Code:
<div id='checkboxes' />
I retrieve the posted input field values in the PHP controller with a:
Code:
foreach ($_POST as $inputName => $inputValue) {
}
My log shows:
[02-Feb-2013 11:16:04 Europe/London] elearningExerciseId : 55
[02-Feb-2013 11:16:04 Europe/London] elearningSubscriptionId :
[02-Feb-2013 11:16:04 Europe/London] participantName :
[02-Feb-2013 11:16:04 Europe/London] elearningClassId : 7
[02-Feb-2013 11:16:04 Europe/London] openingDate :
[02-Feb-2013 11:16:04 Europe/London] closingDate :
[02-Feb-2013 11:16:04 Europe/London] okButton_x : 19
[02-Feb-2013 11:16:04 Europe/London] okButton_y : 14
[02-Feb-2013 11:16:04 Europe/London] formSubmitted : 1
If I append the checkbox input fields not onto the checkboxes div element but on the form itself, with a:
$('#edit').append(
instead of the
$('#checkboxes').append(
then the checkbox input field values are posted fine to the PHP controller. The side effect is that I cannot position my checkboxes where I want on the page.

Any clue ?

Kind Regards,