All Questions
137 questions
0
votes
1
answer
99
views
Inline Javascript throws an error on drupal_add_js() within an AJAX callback
I am trying to get JavaScript to measure a text field and auto submit at a character limit for an Ajax callback to be validated against a Luhn Algorithm and errors out on failure to validate.
I found ...
0
votes
1
answer
509
views
Using JCF with dynamic forms
I want to use Javascript Custom Forms (JCF) to get more attractive and consistent looking forms on my Drupal 7 site. I've got it working to a degree, however when the form changes with AJAX, the new ...
-1
votes
1
answer
36
views
Unable to pass the value from .module file to JS using the implementation given below
.module file
function taxonomy_fancybox_menu(){
$items['fetch-popup-markup-data/%'] = array(
'title' => 'Store markup',
'page callback' => 'ajax_fetch_markup_popup_data',
'page ...
1
vote
2
answers
2k
views
Scroll to search results on Views Exposed Filter submit button
Hi I've made an 'Advanced Search' using Views + Display Suite in Drupal 7.
https://www.oldertenants.org.au/research-library-advanced-search
There's too many search filters so the default behavior of ...
1
vote
1
answer
170
views
Avoid reattaching javascript when a form is rebuilt by ajax callback
I have a form that uses ['#attached']['js'] to attach a simple javascript file. A checkbox element of this same form uses ['#ajax'] to dynamically update some portions of the form. I'm finding that, ...
1
vote
1
answer
522
views
security kit module settings are blocking own site jQuery calls [closed]
I am using Security kit module to enhance security for my website. In that I have enabled Enable JavaScript + CSS + Noscript protection option. This setting is blocking one of Jquery call that is ....
0
votes
1
answer
385
views
Javascript & Ajax failed to load on many pages like field editing & views editing pages.
The site I'm managing is runs by Drupal 7.53 with many contributed modules.
I don't know what happened from yesterday, ajax queries in field editing pages and views editing pages throwing errors or ...
1
vote
3
answers
4k
views
Ajax callback of select form field not triggered when changed by javascript, only when changed manually
I have a simple ajax form with select form input:
$form['children']['number_children'] = array(
'#title' => t('Počet detí'),
'#type' => 'select',
'#options' => range(0, 15),
'#...
1
vote
1
answer
860
views
Trigger an event when file is upload on managed_file field
I'm trying to trigger an javascript function when a user select an image for a managed_file field and click on the upload button, not the submit one.Except that in Drupal 7, managed_filr field do not ...
0
votes
1
answer
2k
views
How to clear a field using jquery after Ajax form reload [closed]
I have a custom module with a custom form with two fields: field A (select), field B (datepicker). When the user picks field B, it launches an Ajax call to validate field B. All works well so far, ...
0
votes
1
answer
626
views
Using 'return' with an ajax callback renders an entire page before my content is loaded
I'm developing a module that uses Openlayers maps and Drupal Commerce. When you click on the map, you should see products that relate to those coordinates of where you click. I have this working ...
1
vote
1
answer
65
views
How do I add authentication to a POST request on an implementation of hook_menu?
I have a list of lesson plans, sorted by category. Underneath each category, I have a link called "Add new lesson/category/root term".
I would like it so that when the user clicks on "Add new ...
0
votes
1
answer
1k
views
calling a block views by ajax
I have a views with three displays which sorts comments of a node in newest, oldest and most popular order. These views are shown below the content and works with contextual filters. I have used ...
0
votes
1
answer
1k
views
Drupal jquery behaviors & views - Ajax multiple times / wrong arguments - triggerHandler('RefreshView')
I am having some problems using ajax to trigger an views update (D7).
Basically there is a map (leafletMap) and when it is moved/changed/zoomed, a function gets a list of node ids and triggers a ...
1
vote
1
answer
686
views
Drupal.attachBehaviors only working for some fields when using Ajax .load
The following code works for some things that I do in terms of .load() such as adding Chosen to fields.
But it won't do anything to date fields, conditional fields or field groups. They get left with ...
3
votes
2
answers
187
views
Adding a jQuery interaction with Views Accordion [closed]
I have a Views Accordion displaying some books under their categories.
I want to add some jQuery interaction, so when the user clicks the triangle of each category, the content will be loaded via ...
0
votes
1
answer
191
views
Behavior being fired on backend causes AJAX error
I am using jQuery Update to bump up the jQuery version on the front end, and keep the default 1.4 on the backend.
On a custom filter form on the home page, i use jQuery on, and wrap it in a behavior ...
0
votes
1
answer
43
views
jdrupal entity_index success function not called
I have an ionic 1 app with jdrupal. In a controller i query a remote api with this code:
// If logged in:
console.log('Hello ' + Drupal.user.name);
// Get the Contacts list.
var query = '';
var ...
0
votes
2
answers
57
views
How do i ajaxify /Use ajax on Side bar custom menues so that links are loaded to my content div without refreshing page
I have a vertical menu on My site ,I want to use ajax to load the Menu link into the content so the page doesnt have to reload,Please how can i go about it ,I tried the ajaxify module it doesnt seem ...
0
votes
1
answer
221
views
ajax pager working depends on if js file is loaded in module .info file
I'm using the code I've outlined in my blog post for a custom image search, and I'm having a problem with the pager, but only on one site. The first page of results renders just fine, but when I try ...
1
vote
0
answers
42
views
jQuery with ajaxify form field
I write a small module which calculate 2 values out of nodes and print it in a block with two form fields. One with the value as markup and the other is a ajax checkbox that switch through the two ...
1
vote
1
answer
2k
views
Cannot bind delegate onClick event on .use-ajax elements
I have a view, that is refreshed with ajax. I'm using Jquery 1.7.2
You click a button, that call a javascript function :
$(view_identifier).trigger('RefreshView');
Before this refresh, I've ...
4
votes
0
answers
504
views
View exposed filter block no alter form with ajax
I am trying to filter out the no results items in my exposed filters. (I know i can use selective filters, but in this case i can't use them).
So i alter the filters with form_alter, check which ...
1
vote
1
answer
182
views
Ajax problem on node edit page trigger whole submit
I'm facing a very strange problem on one website.
First of all with the module media (I'm using the last version of the module). When click on "Remove" an image, an ajax request is triggered and ...
0
votes
1
answer
665
views
How to hook "/system/ajax" with javascript in Drupal 7
When a field accepts multiple values, the admin form adds a button "Add another item". Mousedown submits a POST to /system/ajax to get another field (i'm using multifield here).
I'd like to hook into ...
0
votes
1
answer
135
views
How to expose variable from php to js - and keep it updated?
drupal_add_js works to pass variables from php to javascript, and there are plenty of examples. But I want the variable to update without a new page request.
I have a page request that kicks off some ...
1
vote
2
answers
159
views
Images sent via AJAX, saved to database but not shown on the node
I've got this weird problem. I've been developing this phonegap app and it's in the testing phase now, and this is where the nightmare begins. I am able to successfully upload images encoded as base64 ...
2
votes
1
answer
94
views
"Click to show" text at pages [closed]
How can I implement "click to show" some text data at pages?
Also I need to save log in database about events.
I've found tiny module Field Value Loader (Show field on click).
Any suggestions about ...
0
votes
1
answer
116
views
How to interruput ajax request but keep for next possible uses?
I want to add simple confirmation box for ajax delete action created via:
ctools_ajax_text_button
JS:
(function ($) {
Drupal.behaviors.mymod = {
attach: function (context, settings) {
...
0
votes
4
answers
3k
views
How to run jquery codes before and after ajax call?
I want to create a loading code while the ajax call is not yet complete, AND enable my jquery code after calling the ajax of drupal form. The ajax I'm referring to is the "Add new field/Add more" of ...
0
votes
3
answers
1k
views
drupal_add_js not working
I have this code in my javascript:
(function ($) {
Drupal.behaviors.myid_print_table_id_link = {
attach: function (context, settings) {
$.ajax({
type: 'POST', ...
1
vote
2
answers
588
views
Ajax not output to Ctools modal when using pager
So in my continuing quest to display a form with Solr search results in a Ctools modal window and use a pager, I've managed to get everything to display fine after the initial search, but when I use ...
1
vote
0
answers
678
views
jQuery clone of an select form with ajax event
I'm trying to clone with jQuery the block which contain a form with an ajax event.
function module_api_change_currency_form($form, &$form_state){
$form['currencies'] = array(
'#...
1
vote
0
answers
439
views
Infinite Scroll on Drupal 7 with AJAX
I am trying to create an Infinite Scroll system to display past events on a page.
What I want is, when the top of the page is reached, I want to load past events.
I created the following JQuery:
(...
2
votes
0
answers
1k
views
How to tell if user selected an autocomplete option in a form? [closed]
I created a form that has an autocomplete field of registered users and it is attached to nodes. In the form validation function I check if the string of the textfield is a valid user but in order to ...
0
votes
1
answer
141
views
Not able to overwrite old value in Drupal.settings
I am facing Problems in overwriting old value in Drupal.setting.
Problem Statement
I am passing FID value from PHP to JS. At first it is getting correct value in JS.
Ex. When PHP is passing FID=59 ...
2
votes
2
answers
1k
views
Webform live calculations in table/matrix
I am trying to create a work time allocation webform. My goal is to create a table (6 columns and addable rows) and get a live sum of all columns at the bottom. (edit: pardon my lacking terminology. ...
0
votes
1
answer
903
views
Conflict between ajax callback and jQuery UI dialog
I have a button that triggers an AJAX callback with the form api like so :
$form['show_modal'] = array(
'#type' => 'submit',
'#value' => t('Some crazy text'),
'#ajax' => array(
'...
1
vote
1
answer
818
views
#states not detecting a change to form via ajax_command_invoke
I have a form. On an elements I have an ajax call back.
In the callback I use the commands[] to update some elements on the screen.
One of the elements i have updated is used by another form element ...
0
votes
0
answers
94
views
Pretty Tag display for entityreference (autocomplete)
I'm using entity reference and entity reference autocreate to make entities on the fly if they don't exist. Works like a charm. Now I would like to make a nicer tag display. The standard comma ...
1
vote
0
answers
52
views
Is it possible to port a jQuery module using ProtoType.js to Drupal 7?
I've been the maintainer of an integration module for phpFreeChat since Drupal 5. I ported it to Drupal 6 with no problems, and I tried to port it to Drupal 7, but it hangs when the chatbox starts to ...
0
votes
1
answer
1k
views
How to do autocomplete in a Bootstrap modal form?
I've got a D7 page that constructs a Twitter Bootstrap modal form; it appears in response to a click on a button on the page. I'd like to have in that form a textfield that uses the standard Drupal ...
1
vote
1
answer
271
views
ng angular typeahead drupal
Has anyone got the angularjs bootstrap-ui "typeahead" widget to play nice with drupal autocomplete?
seems like a match made in heaven
I will try this in the next week or so - but just checking if ...
0
votes
1
answer
938
views
ajax update block on click to link
I am using jQuery Ajax Load module in my site to load some contents from url to show on specific div which has a required class. With this module I am able to fetch the Page content from URL through ...
2
votes
2
answers
1k
views
How to validate file is selected or not on ajax processed jquery validation
I am trying to do jquery validation on file upload for file is select or not. I want when user click on upload before submit check file is selected or not. if not stop ajax request. Any Idea to ...
1
vote
0
answers
122
views
Is it possible to build a form with jQuery and still use ajax elements and Drupal 7 Form API?
I have a form built using for the most part many ajax elements within the form api. The form is working if a user is going through it at a normal pace however as this is to be a productivity tool, any ...
2
votes
1
answer
833
views
How to pass node ID argument to Drupal 7 div auto update ajax script
EDIT: There seems to be a ready-to-use http://drupal.org/project/block_refresh module available as @albertski indicated, so no need to struggle to develop a new module.
I've implemented the code on ...
1
vote
4
answers
5k
views
prevent script to run twice after 2 ajax loads
I use colorbox node, which loads a node inside colorbox overlay. Inside colorbox I load a jquery script to add some parameters to all links inside. However, the loading is done by 2 ajax calls and I ...
0
votes
1
answer
680
views
My website suddenly started giving Error 200 on anything AJAX related!
The other day my website suddenly started acting weird. When using the Flag module to flag content, i get a 200 error! The content does get flagged once i refresh the page, but when clicking the flag ...
1
vote
1
answer
703
views
How can I load content on the same page from a search
So the idea is to load the results of the search on the same page. I was told to look into SOLR, but it looks like we have something similar to SOLR , and we just need to know how to load new page ...