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

learn more… | top users | synonyms

0
votes
0answers
7 views

CKeditor ignore height (rows) when displayed into vertical tab

When CKeditor is included into vertical tab (not the firstly visible tab) the height size is calculated from the container (tab) and ignore the rows attributes from the textarea. What's the good way ...
2
votes
1answer
156 views

How to add JavaScript code to a webform?

I want to add JavaScript code to a webform. For example, to add things like onclick, onchange, mouseover function to webform's textbox, textarea, select, email, etc. How do I do so?
0
votes
2answers
33 views

How to call a javascript function?

I have included in my theme a new javascript library(Easy-Responsive-Tabs-to-Accordion) which converts horizontal tabs to accordion. So I have included in my .info theme scripts[] = ...
0
votes
2answers
34 views

Is it possible to present live-site presentations in Drupal? [closed]

I am looking for a modular way to present live presentations in my site. I don't want to add a MS powerpoint file to my site, rather making a presentation that looks very much or exactly like the one ...
0
votes
1answer
29 views

POST request to /user [closed]

I am trying to login to Drupal remotely. For this purpose I've got the following code: $('#submit').click(function () { var u = $("#username").val(), p = $("#password").val(); ...
0
votes
0answers
16 views

Drupal absolutely refuses to serve gzip css and js files, however they are produced just fine. What could be causing this?

What I have tried so far: All variations of modifications and additions to .htaccess gzip relevant sections near the bottom. The Advanced CSS/JS Aggregation module, and all suggested configurations ...
1
vote
1answer
19 views

How to access global variable from within Drupal content

I am trying to access a global variable I created using javascript within a content node i created. In an attached js file i have var rootpath = "/clients/UMP/"; Inside of my drupal page i have: ...
0
votes
0answers
26 views

How to change url of views exposed filter, where will be send a request

I need to change a request in javascript of views exposed filter. I want send value clean url arguments in the exposed filter. I have a part of code but it doesnt work. Will be gratefull for the ...
1
vote
1answer
39 views

how to have conditional Help text for a listbox field [closed]

Remember the create password page of Drupal! While you are entering characters it tells you how strong your password is! Now I want to have something like this in a list box but a bit different. I ...
0
votes
0answers
9 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 update is used by another form element using ...
0
votes
1answer
13 views

Where to place JS code to be used by Admin? [closed]

I have a simple requirement that I want to implement JS on couple of fields. Through JS, I want to hide few fields by default and show them when a checkbox is clicked. The problem is where to keep ...
0
votes
1answer
12 views

Can I attach a javascript function to a Drupal.behaviors javascript function?

I want to trigger another function any time Drupal.behaviors.MultiPage (found in field_group/multipage) changes page. It's part of this code: Drupal.behaviors.MultiPage = { attach: function ...
0
votes
0answers
6 views

How to add KnockoutJS to Drupal forms?

Does anyone have experience on adding front-end framework to Drupal? From my experience I see few problems FAPI and field/input attributes for KoJS dynamically added inputs: fapi doesn't allow ...
0
votes
1answer
26 views

Creating an iframe playlist that loops through urls (from a node field)

Scenario A content type called "Playlist" exists. Playlist has a text field: field_playlist_sources. When a user creates the Playlist they can add multiple values for field_playlist_sources. Each ...
0
votes
1answer
15 views

Override alter.inc in child theme

Bootstrap.js is breaking a menu plugin I'm using. It's called with this $bootstrap = $theme_path . '/js/bootstrap.js'; $js[$bootstrap] = drupal_js_defaults($bootstrap); $js[$bootstrap]['group'] ...
0
votes
1answer
42 views

Suddenly I can't use the “Media” file uploader in Full HTML CKeditor edit screen but can do in Filtered HTML edit screen

I Use D7, CKeditor v 1.16.7 and Media v 1.5.7, all other modules are up2date and the site itself works fine. I don't recall any special change at the site that would avoid this module of working, yet ...
0
votes
1answer
12 views

Load a Module versus JavaScript embedded in Theme

I am new to theming Drupal and I am trying to create a responsive website based on Bootstrap with an image slider at the top. I know that there are modules like Views Slideshow and FlexSlider. ...
0
votes
2answers
52 views

How to add a checkbox to a Content Type and act if box is set to true or yes

Module name, 'text_grabber' Content Type, 'node' name 'essay' **When I enable this module, I want a checkbox to be added to the ~/node/add/essay page. So when an user adds a new essay to the site ...
0
votes
0answers
25 views

Plugin still uses the old version of Jquery even after hook_js_alter

I have drupal-7.34 installed and Im using Jquery Update 7.x-2.5 to make my plugins work. Everything is working fine until I had use a plugin which needs a more recent version of Jquery(jquery ...
0
votes
2answers
29 views

Call a Javascript Function and Update my Form Element at the same time

This is my ajax callback function function myid_search_idnumber($form, $form_state) { return $form['id']; } It updates the values in $form['id']. But Because I wanted to call a javascript ...
0
votes
1answer
50 views

In custom module - No such file or directory in drupal_build_js_cache() (line 5008 of /mnt/www/html/xyzexample/docroot/includes/common.inc)

I am newbie and working on Drupal-7. I have created custom block module called 'mycampaign' to add script to Retargeting Tags into each page. Script: <script async ...
0
votes
0answers
14 views

Alter js in Some Certain Conditions

I am using hook_js_alter to use a newer version of Jquery. function myid_js_alter(&$javascript) { // Swap out jQuery to use an updated version of the library. ...
0
votes
1answer
22 views

How to add Retargeting tag into each page?

I am using drupal - 7. I wanted to embed <script> tags for Retargeting tag into each page of the Website, between the <body> </body> tags. I am new to Drupal. I am trying to ...
0
votes
1answer
20 views

How to find if file was successfully uploaded to webform

I am using the file field in webform, I would like to check if the file was successfully uploaded. I was using .onChange But that only means that a file was attempted to be uploaded. How can I ...
0
votes
0answers
34 views

How to position javascript file as the last one to load?

In Drupal 8 the weight for javascript files in libraries is not supported, or at least only negative values are allowed, which means I am only able to position them at the top of the list (i.e. load ...
1
vote
0answers
29 views

Drupal form #ajax callback and javascript toggleClass on radio buttons - reduced functionality

we're using drupal and I have setup an ajax callback on a form item. The form item is a radio button with two options on/off. also attached to the radio button is some js to toggle a class. The class ...
-1
votes
1answer
37 views

How to integrate addthis into drupal?

I want to use addthis (www.addthis.com) in a drupal website. After making my account in addthis they say I should add the following There is a module which support addthis but it is not good for ...
1
vote
0answers
15 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, ...
-1
votes
1answer
89 views

Using jquery-match-height to set two blocks to equal height

I'm new to jquery and adding it to Drupal. I'm trying however to add this library to my Drupal site so I can set two of the blocks on my home page to equal heights. But it's not working and I'm not ...
0
votes
1answer
22 views

Leaflet library not avaliable even though it's in sites/all/libraries

I've seen people talking about hook_library() etc., but I'm not creating a custom module, I'm trying to use Leaflet. In the browser I get the error message: L is not defined From leaflet.drupal.js ...
1
vote
0answers
11 views

Drupal.ajax.keypressResponse Error

I've been using the code below, that can be found in the link: (function ($) { Drupal.ajax.prototype.keypressResponse = function (element, event) { var ajax = this; ...
0
votes
1answer
43 views

Callback Function not called using Ajax

Below is my code: function id_print_user_page_form() { $form = array(); $form['idnumber'] = array( '#type' => 'textfield', '#ajax' => array( ...
0
votes
0answers
20 views

Datepicker disappeared from Drupal Rooms module

I have been struggling with this for a couple of days now. I installed Drupal Rooms module (D7), everything worked just fine, but after fiddling around on the site, the datepicker functionality ...
0
votes
1answer
47 views

Parallel Execution of Javascript Function and Drupal's Default Event After Submit

I was trying to save something in my database using the following code below: function myid_user_page_form(){ $form = array(); $form['submit'] = array( '#type' => 'submit', ...
1
vote
2answers
54 views

Using PHP arrays in Javascript Drupal 7 [duplicate]

I've been stuck on this all day and I haven't been able to find an answer that solved my issue: I need to make a PHP variable available in my Javascript file. Currently I'm using a fetchMarkers.php ...
1
vote
1answer
35 views

HTML table to Drupal table

How can I translate this to drupal table? http://www.bootply.com/sXmuAJQjO4 I know how to do simple tables and the header and first row I can do also with this code: $title = '<div class="panel ...
0
votes
1answer
41 views

Load Javascript when a particular form is loaded

I have the code below in my own drupal module(myid): myid.module file: function myid_init() { drupal_add_js(drupal_get_path("module", "myid") . "/js/myid.js"); } function myid_menu() { ...
1
vote
1answer
68 views

Is it possible to append Media's file browser to a certain node type?

I have a certain node type with a canvas on it, allowing users to draw on the node. Basic functionality such as lines are working, but I'd like to allow people to upload images to it as well. Since ...
2
votes
2answers
141 views

how to make fewer http requests

I'm use YSlow to optimize my web pages it says: This page has 34 external Javascript scripts. Try combining them into one. This page has 5 external stylesheets. Try combining them into one. but all I ...
0
votes
1answer
29 views

Drupal calendar popup - Year dropdown not showing in colorbox - Screenshot added

I am using drupal calendar pop up in colorbox.when i clicked on year its not showing year dropdown but giving js error of TypeError: m.replace is not a function Above issue is coming in Firefox only. ...
0
votes
0answers
29 views

Applying javascript to an ajax quicktab result

I have made an interface with some quite sophisticated functionality - tabs (module Quicktabs), containing views (module Views) from nested taxonomy (module views tree), containing tables which are ...
1
vote
1answer
23 views

How to create inline node-add forms using a block with content type names

The following page setup is needed: A block (at the left, see image) with links to node-add forms, which open inline (the area at the right) in the current page. The reason why the form needs to ...
0
votes
1answer
38 views

JS error(s) with Media-7.x-2.0alpha4 and CKEditor

I'm working on a production site that is using Media-7.x-2.0-unstable6, File entity-7.x-2.0-unstable6, and Wysiwyg-7.x-2.2 (with the CKEditor 3.6.3.7474 library installed). This is fine for inserting ...
0
votes
1answer
40 views

OnClick Event not Captured

I was currently developing a module(myid) in Drupal. I made a button(#myid_registrar_button) that must alert whenever it is clicked. Below is my code: myid.module file: <?php function ...
0
votes
1answer
24 views

How to add tracking scripts from external sites?

We want to use several lead tracking snippets of code on various pages. <script type="text/javascript">llfrmid=123456</script> <script type="text/javascript" ...
2
votes
1answer
97 views

Any way to alter script tag for some javascript and add custom attributes?

In order to work with Cloudflare's Rocket Loader service, certain scripts need to have their script tags updated with the cf-async="false" attribute like so: <script type="text/javascript" ...
0
votes
0answers
61 views

How to trigger ajax Form API action by js

In a custom form you can add an #ajax property, e.g. $form['some_element'] = [ '#type' => 'textfield', '#title' => 'Foo', '#ajax' => [ 'callback' => 'foo_callback', ...
0
votes
1answer
63 views

How to parse PHP variables in drupal_add_js in template.php

I'm using drupal_add_js for some inline jQuery - I need to parse some php variables in the inline jQuery, what is the correct way to do it? drupal_add_js('jQuery(document).ready(function () { ...
-1
votes
1answer
43 views

Scrolling problem

Here I have a challenge. When I am logged in in my Drupal site: NO PROBLEM WITH SCROLLING THE PAGES When I am lopgged out: I can't scrolll the page as normal. This problem only occurs with Google ...
1
vote
3answers
68 views

My .js file is not included in my site

I am working on Recruiter distribution which uses a Cloudy theme. I have tried 2 ways to add custom javascript to my site: 1)Adding jquery code to the .info file of Cloudy theme(default theme) ...