jquery - Questions about Drupal and Ajax -
i have custom module, module generate table buttons. when button clicked load ajax form display in div. hook menu call function example /myapp/get_form.
the problem comes when have save data of new generated div. created div save data ajax ( $form['submit'] = array('#ajax' => array(...))), new form not save data ajax, form post data /myapp/get_form, not behaviour need.
so have 2 questions.
- how post data generated ajax in new form?
- would ok save data (node) jquery disabling submit , using ajax+json?
thanks!
you can use jquery .submit method prevent default submission beahvior , handle trought $.post
notice fields/modules , #ajax stuff require additional javascripts included in full page load.
to them should retrieve them $js_list = drupal_add_js() , add current page jquery (eg adding them tags in head of current page.)
after scripts loaded call drupal.attachbeahviors() attach newly loaded javascript functionality new form.
Comments
Post a Comment