Skip to main content
Axel Stone's user avatar
Axel Stone's user avatar
Axel Stone's user avatar
Axel Stone
  • Member for 9 years, 8 months
  • Last seen more than 7 years ago
awarded
awarded
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
No, all the code is executed only after $(document).ready() and even few secs later. It would be too easy :).
comment
Why is my theme function not called (not in template file)?
I also noticed than my custom module is in 'activit' folder and the same name has the folder where my theme is. Maybe that is the problem.
comment
Why is my theme function not called (not in template file)?
I cleared the cahce multiple times... I just checked my previous projects and realised that in every project I've made (D7) I used arguments and file template. It is the way I am used to. It allways worked. I also tried what you said - to use variables but it still just does not work when the theme is defined as a function theme_activit_package_teaser() :(
comment
Why is my theme function not called (not in template file)?
That's weird because now I have the theme html in .tpl file and it works even if i still use arguments. Check update of my question.
revised
Loading…
Loading…
awarded
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
I have tried to to use .click() on select and then .click() on the option DOM element but it does not work on select element: stackoverflow.com/questions/430237/…
Loading…
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
Yes, I've tried multiple ways including this one, but it all works only when typed in browser console (maybe in .js file too), but nothing works if the code is executed by my chrome extension. It is weird... does Drupal somehow verify what exactly triggered the event? Is it even possible?
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
Nope. The command is in a function that is executed by setTimeout(), but that should not be a problem. I'm lost now.
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
Probably you're right. I just found that if I type directly to console command $('#children-div select[name="number_children"]').val('3').change(); it will properly trigger a change event. But if the same command is executed by my chrome extesnion, for some reason it changes the value but doesn't trigger an ajax.
comment
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
No, there is nothing special in setup/code. Maybe there is more complicated drupal JS mechanism that is triggering ajax than a single change event.
Loading…
awarded
Loading…
comment
how to send variable from .php file to .js file?
What does the function do and when is it triggered? Why not to use directly Drupal.settings.YOURMODULE.testvar?