I have the following form: form pic

When I click the "Add Filter" button, I need to open a modal with a select input element. Then I need to send the user's choice back to the Drupal Form instance and extend the original form, based on the user's input.

I'm not sure of the best way to do this. 2 options I've thought of are:

  1. Is it possible to have the "Add Filter" ajax callback send an "OpenModalDialogCommand" with a new form, then have the new form "submitForm" method send the data to the original form?

  2. Another possibility would be to collect the data clientside and send it to the original form.

However I'm not sure how to get the user data into the original form in either of the options above.


I have worked on a similar case in D7. Take a look at these tutorials. https://www.deeson.co.uk/labs/insert-form-pop-modal-ctools-and-drupal-7 http://internetdevels.com/blog/big-manual-for-creating-ctools-popups-in-drupal-7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.