If you're working with D7 AJAX Forms, you will be interested in an API change this week.<br><br>With <a href="http://drupal.org/node/684846">http://drupal.org/node/684846</a>, the AJAX triggering was refactored, and this has some effects on those of you using it:<br>
<br>The bottom line: The submit function and form_set_error() actions only take place when the entire form is submitted, and do not take place in an AJAX triggered event (unless it's submitting the entire form).<br><br>
1. Fields don't get errors reported against them in the context of a single-element AJAX event. So for example, if you're triggering on a select and there is another required field in the form, form_set_error() will not report the fact that the other required field is still empty.<br>
<br>2. The _submit() function is *no longer* executed during an AJAX submission, only when the form itself is submitted. It's only run when the whole form is submitted. If you have behavior in your module that depends on this, you'll have to change this.<br>
<br>I had some contrib code broken by a recent small interface change in D7, and I think we should probably make announcements to this group when these interface changes happen. I haven't figured out a better way of notifying authors who might be affected.<br>
<br>PS: There is some new documentation on AJAX forms at <a href="http://drupal.org/node/684846">http://drupal.org/node/684846</a>. Your review and suggestions are welcome. <br><br>-Randy<br clear="all"><br>-- <br>Randy Fay<br>
Drupal Development, troubleshooting, and debugging<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>