2

I have a complex node form with a series of dependent dropdowns (pick option a, update choices for option b, pick b, update choices for option c, etc.). It's all working fine with the standard ajax framework built into the Drupal form API. But it's really, really slow - every ajax call causes every form field to be validated, the (complex) form_alter function is called twice, etc.

Is there a better way to decrease load time?

In my particular case, I don't need all of the overhead. It's really easy to write a simple, speedy callback to validate selection a and generate the new set of options for b, and easy to update b on the form using normal, non-FAPI ajax. But when the form is submitted, the selection for b does not validate (since the form knows nothing about the new set of options). Is there a way to overcome that hurdle and feed the new options into the form without going through the FAPI ajax workflow?

Note that this is NOT a custom form, but is a node form being customized through a hook_form_alter .

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.