Answer the question
In order to leave comments, you need to log in
How can I correctly connect the script to the views exposed filters form in drupal?
Everyone knows what a standard multiselect looks like in views exposed form. This is a list with the ability to select one or more values.
Everything seems to be simple. I connected another script to the form, turned it into a dropdown multiselect with wide possibilities. In the theme, drupal added js and css using the add_js and add_css methods with paths. Everything works as it should.
The problem is that every time the page is reloaded, the standard multiselect is displayed first, and only then (depending on the speed of the Internet) the view changes to what I intended.
I read many forums, tried to find answers. But I can't figure out how to get rid of this annoying standard multiselect!
View of my js document:
jQuery(document).ready(function($) {
....
});
Answer the question
In order to leave comments, you need to log in
Write a module that intercepts form generation.
<?php
/**
* Implements hook_form_alter().
*/
function mymodule_form_views_exposed_form_alter(&$form, $form_state, $form_id) {
drupal_set_message("Form ID is : " . $form_id);
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question