I have a view of node teasers. I have added custom form to every teaser. Form is submitted via Ajax (in theory).
Code for submit button:
$form['my_module_form']['submit'] = array( '#type' => 'submit', '#value' => t('Send'), '#ajax' => array( 'callback' => 'my_module_form_ajax_callback', ), );
Form is added in hook_node_view like:
$content['my_module_form'] = drupal_get_form('my_module_form', $node);
Anyway after loading content by autopager ajax event isn't attached to any of new forms.
I looked to the views_infinite_scroll.js and events are attached:
but it doesn't work in my case.
Ajax works like expected on content loaded via normal page refresh. Forms from content loaded via pager, submit only as a normal request (no ajax)
I have posted it in module issues, but without any feedback, so I'm trying here.