Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
5 votes
2 answers
5k views

custom module: drupal_add_js and drupal_add_css do not work after form validation?

I have created a custom module that changes the layout & adds extra functionality to one of my content type creation and edit forms. It works beautifully and as expected apart from when I submit ...
tecjam's user avatar
  • 1,151
10 votes
4 answers
21k views

How to make form buttons call only javascript?

I'm experimenting with JavaScript and Drupal forms. Currently I'm trying to make a button in the administration form of a module that will use JavaScript to append options to a select list. The ...
Sathariel's user avatar
  • 679
5 votes
1 answer
2k views

How do I display Search API Facets and Openlayers Proximity search in one view?

I am trying to add search facets to a specific views page that uses the openlayer proximity filter. So far I can only show facets in a view if I create a new view showing the search index I created in ...
tecjam's user avatar
  • 1,151
1 vote
1 answer
1k views

Show jCarousel if number of items are more than 3

I am using the jCarousel Views module; I want to hide the view when the number of items are not greater than 3. How do I do it?
Hacker's user avatar
  • 3,024
4 votes
1 answer
2k views

Load and interact with a node comments from their related node

I am having some trouble in my quest to build a Drupal 7 custom node based image gallery module. I've got it working, but now I need AJAX to load and manipulate comments. What I am doing I've created ...
Macronomicus's user avatar
1 vote
3 answers
1k views

Adding jQuery Timeline to Drupal

I have found this awesome jQuery Timelinr that I have customized for my Drupal site but am now at a loss at how to insert it. It is only going to be on one page. Does it need to be in a block? Do I ...
Steph's user avatar
  • 11
1 vote
3 answers
6k views

Use my existing jquery function in drupal 7

I have my function like this in jquery $(document).ready(function(){ // set the map-wrapper width and height to match the img size $('#map-wrapper').css({'width':$('#map-wrapper img').width(...
Hacker's user avatar
  • 3,024
5 votes
2 answers
4k views

Drupal 7 user register form in overlay on page load

One of my requirements is to show the user registration form in an overlay kind of interface. From the Examples module issue queue, comment #14 http://drupal.org/node/930058 I found a module, ...
Sivaji's user avatar
  • 2,478
0 votes
0 answers
1k views

Making jCarousel work with view

I am trying to make jCarousel work with Views in Drupal 7. I select the required fields and write in the footer part of the view like the following one: <?php jcarousel_add('slideshow-item-...
Hacker's user avatar
  • 3,024
-1 votes
1 answer
993 views

How to add a timer in views?

I have created a view which displays a list of product in table grid formate with four rows. I have fields related to the product like image,price,descriptions and so on. Now I want to create a field ...
user avatar
2 votes
3 answers
3k views

Is there a way to re-invoke #ajax on forms when the form itself is returned with ajax?

I want to change the delete link on comments so that the delete confirmation is returned with Ajax and then the delete confirmation is executed with Ajax. I have fixed the form so the delete ...
David Barratt's user avatar
0 votes
4 answers
585 views

Content items with multiple images

I have created a content item in Drupal 7 which has multiple image fields (well it has an image field that accepts multiple images). When I display the item, the images are displayed one under the ...
kaliok's user avatar
  • 21
1 vote
1 answer
2k views

Colorbox - Only display some of the images in a gallery

I've got colorbox set up and working great, but I'd just like to do one little thing that I can't figure out. I want to have a colorbox gallery of, for example, a dozen photos, but select three to ...
SenorPuerco's user avatar
5 votes
2 answers
1k views

AJAX post on node edit page

I am trying to perform an AJAX post on node edit pages in a new module I created Proofread Bot. This module adds a button and clicking it performs an AJAX post to a URL for processing text. When I do ...
giorgio79's user avatar
  • 4,651
6 votes
3 answers
3k views

Help implementing Supersized.js in Drupal 7

I am trying to add Supersized.js into my Drupal 7 site. I have updated Drupal to use the latest version of jQuery, I added scripts[] = js/supersized.3.1.3.min.js to my .info file, and in my html.tpl....
Vigo's user avatar
  • 61
1 vote
1 answer
117 views

How to retrive menu_get_object() in javascript, jQuery?

I'd like to use the $node object in JavaScript, preferably Drupal's DOM. Is there a recommended way to do this in Drupal?
Logi's user avatar
  • 719
9 votes
3 answers
3k views

Hide a CCK fieldgroup using #states in hook_form_alter()?

I have a custom module, and I am trying to hide a CCK fieldgroup using "#states" when a certain item is selected in a drop-down select list. I have tried using states from within hook_form_alter(), ...
thepearson's user avatar
4 votes
1 answer
4k views

How to use URL-based AJAX in Drupal 7 to serve all pages?

I know this can be done through jQuery alone, but I'm interested in knowing if there any Drupal 7 ways of achieving this: I want to use AJAX to serve all non-admin pages on my site. Also I don't want ...
kaustavdm's user avatar
  • 337
2 votes
2 answers
705 views

Embedding the s3slider jQuery plugin in a block

How can I add a custom image slider similar to this one in a block? I tried integrating it in a block, but it doesn't work. What is the best image slider for Drupal 7, excluding the View Slideshow ...
Rafee's user avatar
  • 494
1 vote
4 answers
3k views

view slideshow not working

I created a view block and a content type "slideshow image" with "title" and "image" specially for slideshow. In this block only images of "slidshow image" content will appear. And i added up five ...
Rafee's user avatar
  • 494
17 votes
3 answers
4k views

How to handle / cleanup obsolete aggregated css / js?

I'm only using Drupal 7 built in CSS / JS aggregation, however the files folder where the css.gz and js.gz files live are filling up at a fairly rapid pace, and while I'm sure it'll be a while before ...
DanH's user avatar
  • 1,613
1 vote
1 answer
482 views

jQM Theme does not work properly on front page

I've started to use Drupal recently, and installed the jQuery Mobile module and the jQM Theme in order to make a Mobile site / Web app. I'm having some troubles getting it to work properly. The ...
dgsunesen's user avatar
7 votes
4 answers
8k views

Display view nodes in lightbox?

What would be the best way to show the nodes from a view in a lightbox, triggered by a single image? The idea would be that a nice photo is shown on a frontpage. When users click on it, a view is ...
Bart Braem's user avatar
2 votes
1 answer
647 views

Get post information in drupal function

I posted JSON array from my script using jQuery.post , to get the posted data in my drupal module function I am using $json = file_get_contents("php://input"); but is there a better way or a '...
Firdous's user avatar
  • 736
0 votes
3 answers
1k views

Call a php function on text selection in text area

I have a text area in form. When some text from text area is being selected, I have to enable a button. How can I do that?
Srihitha Narra's user avatar
0 votes
1 answer
976 views

Contact Form with drop-down subject (bonus: auto-selected based on GET/POST)

I have a number of services on my site and I want them to all direct to the contact form. Now, this is where it gets tricky- I want the subject to be a dropdown selection of all services provided and, ...
Matt Rowles's user avatar
2 votes
1 answer
2k views

Error when submit a Webform with Ajax using Jquery

I am having a webform in my drupal. I am using the jquery Ajax submit method to submit it. This is the code I am using. $("#webform-client-form-59--3").ajaxForm(function() { $(".talk-region").html(...
esafwan's user avatar
  • 1,348
4 votes
2 answers
1k views

How to trigger JavaScript/jQuery on AJAX-enabled ImageField submit?

I'm trying to trigger a JavaScript event when an AJAX-enabled ImageField submit button is clicked. I've tried variations on delegate(), submit(), and click(), but no joy. This is something similar ...
g_thom's user avatar
  • 672
0 votes
1 answer
586 views

Updating duplicate Flags AND one or more Views blocks on a page on Flag click

I have a page where I have several carousel views that can, at times, show the same item/node in each carousel. Such as a most downloaded and a most viewed. I have two different flags (bookmarks and ...
Patrick's user avatar
  • 1,310
6 votes
3 answers
1k views

Drupal 7 css and js compression

When I turn on Drupal 7 css and js compression in the performance part, it is aggregating too much files.(5 css files and 5js files). Why? The page: Is there any way to force drupal to aggregate ...
enjoylife's user avatar
  • 3,788
59 votes
2 answers
46k views

Better understanding of Drupal behaviors

I read about Drupal behaviors today, and I tried writing the following code. (function ($) { Drupal.behaviors.mymodule = { attach: function (context, settings) { $('#mymodule_id', ...
Hacker's user avatar
  • 3,024
0 votes
1 answer
491 views

Load page through ajax

what are the options (all possible ways) to open a page through ajax in D7?, also can ctools module be useful in this? if yes then can anyone provide an example hint using ctools.
Firdous's user avatar
  • 736
3 votes
1 answer
1k views

Any better popup modal framework in drupal

I use the Chaos tool suite module for modal popup in Drupal 7; I am unable to open popup from within a popup using ctools. Can it be done using ctools, or is there any better popup modal module in ...
Firdous's user avatar
  • 736
29 votes
7 answers
54k views

How to programmatically trigger a click on an AJAX enabled form submit button?

I'm trying to programmatically (with jQuery) trigger a click on button with AJAX behavior in a Drupal form, but so far jQuery('#edit-submit').click() doesn't do anything. A real mouse click on that ...
Daniel's user avatar
  • 1,245
8 votes
2 answers
1k views

Weighting Javascript in .info files

Drupal 7 adds a new 'weight' option to drupal_add_js so that you can control the order in which Javascript files are added to the page. Is there any way to do this when adding Javascript in .info ...
cam8001's user avatar
  • 1,074
0 votes
1 answer
143 views

.js extension for javascript file is missing

I am using below code in my custom module "my_module". function my_module_theme(){ return array( 'my_module_javascript'=>array('arguments'=>array(),), ); } ...
Srihitha Narra's user avatar
0 votes
1 answer
1k views

Ajax fired when Filefield "Add Another Item" button is clicked conflicts with my jQuery code

I have a node type with a multi-value file field. I am using some jQuery code used by a custom module to modify some of the form elements, but when I click on the Add another item button, it ...
1 vote
1 answer
457 views

Drupal 7 js compression generating 6 files

I'm using drupal_add_js and drupal_add_library to add some js to my site. But when I turn on the drupal js compression, drupal is aggregating the files but it's generating 6 files and Yslow is saying ...
Luiz Guilherme's user avatar
6 votes
2 answers
6k views

How to extend or "hook" Drupal Form AJAX?

I'm working with standard admin form, which has 'add_more' button for one of fields. My task is to move some fields to jQuery UI Dialog just for usability. When dialog was closed I manually append it'...
kalabro's user avatar
  • 7,949
1 vote
3 answers
761 views

In hook_boot jQuery is undefined

I am doing some processing in hook_boot since I need that code to run on every page, irrespective of whether or not they are cached. As a result, jQuery is undefined when I add inline JavaScript to ...
dianovich's user avatar
  • 133
2 votes
0 answers
295 views

Create splash ad?

Drupal 7.7. I have front_page installed and working for Anonymous users - testing it out with a ten-second expiring cookie and this: <?php print 'Splash Ad!<br/><a href="index.php">...
Mike's user avatar
  • 755
1 vote
3 answers
630 views

Importing and using overlay from jquery_plugin module

I am trying (and failing) to use the jquery overlay plugin from the jquery_plugin module in Drupal 7. I am using drupal_add_library() to add the plugin and drupal_add_js to add the code to generate ...
Paul Barrett's user avatar
3 votes
1 answer
2k views

Client-Side Equivalent of drupal_set_message with javascript

I've got javascript that notifies the user of actions and errors, and I'd like to use the existing Drupal messaging. Is this built in to Drupal? Alternatively, (I'm fairly new to Drupal and am not ...
Jay Querido's user avatar
6 votes
2 answers
604 views

drupal_add_js and drupal_flush_all_caches

I was trying to call drupal_add_js in the callback of a button. It seems, even with after_build, that this can be done successfully only you are working without cached data. So, before i start the ...
danielmsd's user avatar
  • 163
0 votes
1 answer
665 views

drupal_add_js does not add javascript on after_build

I'm using the following line to add JavaScript code to my module form: $form['#after_build'][] = 'myModule_after_build' In myModule_after_build(), I add the Javascript code with calling ...
danielmsd's user avatar
  • 163
1 vote
2 answers
22k views

drupal_add_js and inline code

I am trying to use inline javascript, added with hook_alpha_preprocess_page, to add support to IE. drupal_add_js(' jQuery(document).ready(function () { if (jQuery.browser.msie && jQuery....
Kevin's user avatar
  • 28k
5 votes
4 answers
2k views

Get this jQuery Youtube Playlist working?

Drupal 7. I'm trying to get this to work - seems simple enough. I added the .js file through my theme's .info file, and it's picking that up. I selected "Full HTML" as the format for my block, and ...
Mike's user avatar
  • 755
25 votes
3 answers
15k views

Multiple Values to Trigger #states

How can I have multiple values trigger the Form API's #states? Say for example, I wanted this field to be visible not only if the value is 5 (currently works below), but wanted to make the field ...
Citricguy's user avatar
  • 7,934
0 votes
2 answers
2k views

How to remove overlay hashtag and trailing menu from the parent overlay

Lets say for example we have activated contextual links & overlay modules and when clicking the edit button for the node, which is all the way bottom of the page, it open on overlay. Now when we ...
Minty's user avatar
  • 572
6 votes
3 answers
8k views

Show node in overlay using drupal 7 overlay module

Is there anyway to open a overlay with a node content using drupal overlay core module? If I could reuse at least the javascript code I'd already be happy =)
Luiz Guilherme's user avatar