Hi,
I have set to one of my select form element the ajax callback, using #ajax key. When selectbox is changed, ajax callback should be called. But system returns error because, one of form elements (not inside #wrapper element together with select) is required.
But I want that form elements are required only on submitting form, not at #ajax callback.
Is it possible to disable validation at all on ajax callback?

Comments

Look at the

Look at the #limit_validation_errors attribute of the form API.

Jaypan We build websites

I think that attribute is not

I think that attribute is not attached to select element. AFAIK it can be attached only to buttons. I would need some alternative to this attribute for selectbox.

I know that this is soehow

I know that this is somehow possible but I cannot find it out. There is no documentation, how can I disable validations on ajax event of selectbox

Is your validation attached

Is your validation attached to the $form, or the submit button? I believe if you attach it to the submit button, it will only be executed if the submit button is clicked - ie not an Ajax call.

Jaypan We build websites

A suggestion

Hello,
Sorry to interrupt :)

I just wanted to remind you that Drupal is open source :)

Writing "documentation" for open source projects (such as Drupal) may be done by one group of folks. Writing the actual source code (such as Drupal's core) may be done by another group of folks. Therefore, the "documentation" and the "source code" may not always be completely in sync,

In addition, programmers often include detailed explanations of how the source code works inside "comments", "comments" located in the source code listings themselves. Those "comments" may be considered part of the "documentation" by programmers. Other folks, such "front end developers" may not recognize source code "comments" as "documentation".

So how do you diagnose an issue, using all 3: source code, documentation and source code comments? The answer is, you run Drupal through a source code debugger, That allows you to view the process and the data structures. As you trace through process you can pause execution and read the source code comments.

The same technique applies to the javascript portion of Drupal which runs in you web browser, Both Chromium and Firefox include javascript source code debuggers. In addition, both Chromium and Firefox include "http monitors" that allow you to view the raw messages exchanged between the web browser and server (E.G. Drupal).

To summarize, using a source code debugger always facilitates a solution :) No need to guess over and over again :) So you can "find it out" :)

There are many great free php development/debug tools out there. Right now, I use netbeans (with xdebug), a free IDE.

Good Luck :) Again, you don't have to suffer through endless guessing. Debugging replaces guessing :)

By the way, if done correctly, your ajax call should not be triggering a form submit.

Thinking is the best way to travel.

nobody click here