JavaScript is a prototype-based object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

learn more… | top users | synonyms (1)

1
vote
2answers
746 views

Adding “onclick” event to links in text areas [on hold]

I need some help getting and "onclick" event onto some links in a couple drupal pages. I've got 2 pages, each with a text entry field set to "full HTML", within which I've added my a tags. the links ...
7
votes
8answers
10k views

How to add a JS confirmation popup when clicking an #ajax button

I have a basic FAPI button input that is #ajax enabled and that's working fine, but I want to add a JS "Are you sure?" confirmation popup when clicking the button before the code actually runs, and ...
0
votes
0answers
590 views

Ajax load some html in Jcarousel?

Though I am able to add items via ajax into a drupal jcarousel, the new items are not being registered and lack the jcarouselindex="N" I've tried jQuery(target).reload but no luck. Does anyone know ...
0
votes
0answers
13 views

“$.fieldValue is not a function” alert on login form submit

In Drupal 7, with Devel, CTools and Ajax Login/Register plugins, I get an alert on submitting the login form on http://p262957.mittwaldserver.info/drupal/user/login. I am using a custom child theme ...
0
votes
1answer
29 views

When using drupal_add_js with the 'setting' option, do the set variables apply for all users?

I am trying to find out if the following function will just set the JavaScript variable for that specific user, or if it will switch back and forth between usernames. function ...
0
votes
1answer
12 views

give value to form element after select event - value should be catched with JQuery

I'm pretty new with Drupal & JQuery. I post this question because I was not able to find a solution in the net. I have a select form element to choose a country. This select displays de country ...
0
votes
0answers
17 views

Multiple Drupal installations each using VirtualHost with their own domain names

Using CentOS, Apache, Drupal 7.x I have my /etc/httpd/conf/httpd.conf file edited to have the following virtualhosts: NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] ...
2
votes
2answers
477 views

Change end date automatically after changing start date

I would like to be able to automatically change the value of the end date to be the same as the start date after changing the start date. Ex: right after changing the start date to 12-12-12, the end ...
1
vote
4answers
457 views

Jquery Update: How to use it only in frontend theme?

I have this problem: using jquery update module, I use the version of jQuery 1.8, this version "broke" the views UI in the Admin theme, it seems that the ajax calls in views UI work only with jquery ...
1
vote
1answer
13 views

Disable Panels Preview when adding new Panes in Layout Editor

Some of my pane's are causing the pane's editor to crash (some cause the grears to dissapear, some cause the add new panes element to break). We'd therefore like to disable the preview option in ...
0
votes
1answer
511 views

Drupal behavior for #datepicker onselect not working

i have a datepicker in a webform. I want to be notified when a date is selected in the datepicker. In my form template i drupal_add_js a js starting with : Drupal.behaviors.booking_form_tma = { ...
3
votes
1answer
60 views

How to pass cookie value into Drupal View

We want to create some logic using JS that creates a cookie and set the node's taxonomy term id (preferred) or taxonomy term name as the cookie value. Then we want to use the cookie value to filter a ...
1
vote
1answer
29 views

file_create_url() equivalent in a javascript file?

I am dynamically loading a script using $.getScript() which works fine, but when using the CDN module it comes from the webserver, instead of the CDN. Is there a way to get the correct CDN path in JS, ...
4
votes
1answer
812 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 ...
3
votes
1answer
662 views

Jquery animate in Views slideshow

Is there any way to add some jQuery animations in each slide of a slider created with Views Slideshow module?
2
votes
0answers
30 views

check url on each and every event on the page [closed]

I want to check url on each and every event on the page using javascript. I am having an issue using tabs and Google map, so I wanted to check url on each event so that when I need I can reload the ...
0
votes
2answers
3k views

Trigger highlight in maparea when mouseover on link

I've created a content type where I can load an image into a text editor and use Image Map Editor to create area to be highlighted when mouse moves over mapped region. At the same time, below the ...
1
vote
1answer
445 views

Tabledrag with locked children

We use Drupal's tabledrag component in one of our interfaces and we've got this requirement we don't know how to solve. Basically, we have a tree structure with elements of 2 types - let's call them ...
0
votes
0answers
26 views

Block the password conformation pop-up window for security concern

In one of our application we need to block the password conformation pop-up window for security concern . Example: When a user creates a new account that time user provides password and in Firefox ...
1
vote
1answer
17 views

Drupal 7 Ajax GET - Error 400 (Hook_menu)

I am trying to send an array back to Drupal to save in a database table. I'm getting an error 400 though when inspecting in the console and the url seems correct: GET ...
0
votes
1answer
20 views

Trigger a JS function only if the view has no more results. or is empty?

Hi this might be a stupid question but i can't seem to work it out. I'm using 'views ajax get', 'views load more (with waypoints)' and what i'm trying to achieve is to only display the footer when ...
35
votes
2answers
22k 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', ...
0
votes
0answers
23 views

How can i add a facebook pixel tracking code to DRUPAL 7 [closed]

How can I add a Facebook pixel tracking code to Drupal 7. Is there a common module that I can add so that I do not have to add the Facebook generated code manually for every Facebook Ad that I ...
1
vote
1answer
27 views

How can I capture JavaScript value for use on tpl.php [closed]

I have a custom module, in a javascript file that is located in the js folder of the module, I captured a value from a previously written function using an if statement. Ex: if($numb==6) show this img ...
0
votes
4answers
518 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 ...
5
votes
2answers
4k views

jQuery.browser.msie depreciated in 1.9 trying to fix in Drupal 7

The design template I am using needs jQuery 1.9. But Drupal 7 doesn't seem to support 1.9. Please correct me if I'm wrong The issue is that when in import jQuery 1.9 in Drupal 7 then here is the ...
0
votes
3answers
31 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', ...
0
votes
1answer
201 views

Hiding Field(s) if Date is Expired

I'm using Drupal 7 date field. Using views, when the date has expired, the page goes to a section labeled 'past events.' In the template page, the date and time are both separated for instance. ...
1
vote
0answers
13 views

Panels problem with changing the width of columns or regions

Some times when I try to change the width of columns or regions with Fluid Width the panels displays the NAN% and it doesn't change the width Using Firebug I got the following error What should ...
0
votes
1answer
27 views

Include Vimeo's Froogaloop library

I have a custom module that has a JavaScript file in it. The JavaScript file is calling on the Vimeo API, which has a custom library created for it (similar to jQuery). How can I use this library in ...
0
votes
2answers
1k views

When I click a radio button its value should display in textfield

Above is the sample screenshot of my form where I would like to do is: When I click/check on radio button "One" then its value should display in textfield of "Display". Code: function ...
0
votes
1answer
471 views

Drupal 7 sending webpage through email

I've implemented hook_menu and in page callback there is a function in my module which retrieves some records randomly and theme them with theme_table. Now I want a button on the page for sending this ...
4
votes
2answers
723 views

Show password button

I'm developing a module and in the settings page I've inserted a text field to allow users to insert a key. I thought to change this into a password field but I want to also create a Show password ...
0
votes
2answers
30 views

ajax_command_invoke not working

I have this function in Drupal: function myid_print_table_pager(){ $html = 'info' ; $commands[] = ajax_command_invoke(NULL, 'myid_print_fill_table', array($html)); $html_page = array( ...
1
vote
1answer
513 views

Jquery breaks on ajax run

I am using field collection & availaibility calendar module, I added a field collection in a content type as a field with unlimited option in field edit. now i have added a availability calendar ...
1
vote
2answers
69 views

How to record what time user has spent on my node?

I want to record the time a user has spent on my particular node so I could show a pop up to the user to register once the user has read 3 article. But the user must have spent at least 30 seconds on ...
1
vote
1answer
588 views

Change Form Single Select element to Multi Select for JS enabled users

I would like to have an exposed filter that shows single select by default, but for JS users is able to be altered to a multi-select. The reason for this is that I want to apply the JQuery plugin ...
2
votes
3answers
3k views

How to override a JS function in the Media Module without editing the actual module files?

Drupal.media.browser.validateButtons = function() { // The media browser runs in an IFRAME. The Drupal.media.popups.mediaBrowser() // function sets up the IFRAME and "OK" and "Cancel" buttons ...
3
votes
1answer
694 views

Views UI doesn't provide links to expand fieldsets anymore

I have moved an entire drupal site to another server. While everything else seems to work fine, I can't quite access collapsed fieldsets in Views UI anymore. It looks like this All fieldsets (STYLE ...
2
votes
3answers
1k views

How to pass PHP variable to javascript in Drupal 7

Javascript works fine, but i need to get my_var variable from module. At the moment its not working. Clear my page cache and browser cache several times. The variable 'my_var' is showing value on ...
0
votes
2answers
31 views

How to call external api to pull data into json format?

There is an api that is used to expose data from an external website. How can I use the drupal API to call the external api and pull the data into json format? the external api would be, for example, ...
0
votes
1answer
3k views

Link to anchor on current page with smooth scroll

I have smooth scrolling working (https://drupal.org/project/scroll_to_destination_anchors) and I have linking to anchors working (https://drupal.org/project/menu_token) but I can't get my desired ...
0
votes
3answers
43 views

How to avoid module specific jQuery plugin script running globally?

This is my first time working with Drupal (Drupal 7). I've created a jQuery plugin which populates a target div. The target div is added to the node via panelizer. I only want to run the script for ...
1
vote
1answer
28 views

.trigger(“click”) not firing [closed]

I'm trying to automatically launch a dialog box containing an iframe if the user's cursor gets within 25 pixels of the top of the browser window. In the code, a simulated click of a hidden button ...
0
votes
4answers
935 views

Add an external jQuery based library in Drupal 7

How can we add an external javascript library that relies on jQuery by calling $(document)?? As Drupal 7's jQuery needs to be encapsulated, adding the library just generates errors: $(...) is not ...
1
vote
0answers
19 views

Ajaxblocks only working for first block

I've installed the Ajaxblocks Module (see https://www.drupal.org/project/ajaxblocks). I have 2 blocks to be loaded by ajax. The AJAX request looks like this: ...
1
vote
0answers
19 views

Chocolat.js - lightbox is not opening [closed]

Created view called portfolio and every field (title, images, body etc) is excluded from display except images. Images will be laid out in bootstrap thumbnail setting. In bootstrap thumbnail view: ...
3
votes
2answers
37 views

Hooking a JS script at node submission to alter data submitted

I am building a website in which a lot of the text comes from Word docs. The problem is that when you copy from a Word doc to WYSIWYG editor, the resulting HTML and CSS is horrible. I want to ...
1
vote
1answer
1k views

jquery slideToggle reverts back to initial hidden state after running

I have a super fish menu and a simple jquery slideToggle animation attached to each menu item. I am using drupal 7 & the superfish module. the idea is that on click it will show the body content ...
0
votes
2answers
530 views

How can I add “x-tmpl” script tags to the page for use by Backbone/Mustache?

I'm building a D7 site that uses Backbone to parse JSON data (from Views JSON), and then feeds it to a series of Mustache templates for rendering with Javascript. I want to keep the Mustache ...