How is it possible to detect if the page, in which the form is, is refreshed and to detect if only the form is refreshed?
I tell you the whole thing: I'm building a module. The form in this module has ajax-ed elements. When the form is first loaded (or when the page containing the form is refreshed) a database query is executed (filling up the form), that is the thing i want. But when an ajax-ed element is triggered the query is executed again, and i don't want that.
How is it possible to stop the execution of this query when an ajax callback is executed?
The form is in an .inc file and called by the .module file via drupal_get_form()
.