Tagged Questions

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions.

learn more… | top users | synonyms

0
votes
2answers
16 views

How do I include jQuery scripts at the bottom of the <body> tag?

I want to include a JavaScript file at the bottom of the <body> tag, and I only want to include it for a specific node type, but my node.tpl.php file's content is only wrapped by ...
-1
votes
0answers
16 views

Is there any awesome and easy use jquery image gallery module or plugins? [duplicate]

Dose anyone can share any awesome jquery-based image gallery plugins or Drupal modules? Or when you have to make such functionality, how did often solve the problem? (Coz it is time-consuming to code ...
0
votes
1answer
15 views

Where to write a jquery script for a registration form page which created using webform module in Drupal 7?

I have created a registration form page using the webform module. The registration form page contains personal info and billing info groups with fisrtname, lastname, email, age fields and a check box ...
-1
votes
0answers
12 views

Ajax works with some roles in drupal

I know the title isn't explicit but i have a problem with my ajax function and the differents roles in drupal. I created two function in my code and none is working when i used a normal role like ...
0
votes
1answer
15 views

jQuery length of object to determine existence gives error?

The following jQuery in my module gives an error that breaks LOTS of other javascript on other modules on the page. I want to know why. Why? var pid = $('input[name="product_id"]').attr('value'); ...
0
votes
2answers
21 views

how to connect to database for form submission

I have website and on its home page there is form in which user enter his own label .As user enters label if the user with same label exists in database it through message that "This Label already ...
0
votes
1answer
48 views

Capitalize each word's first letter while entering node with javascript [on hold]

I want to capitalize the first character of each word while entering node titles (and some other fields) with JavaScript. For example: First node title -> First Node Title second NODE tiTLe -> ...
0
votes
1answer
22 views

Getting all other checkboxes other than the one checked with jQuery [on hold]

Based on my inability to use the FAPI #states property for toggling between two checkboxes (and to pre-empt any questions about why I'm not using radio buttons, it's because each checkbox option has ...
-2
votes
0answers
11 views

Is there a module or package to allow Select2 on both entity reference fields and webform lists?

Is there an existing module, or specific process for implementing Select2 on all entity reference fields and all webform select lists?
0
votes
1answer
18 views

Undesired toggle effect with #states and checkboxes

I'm working on a patch for the Login Disable module, and on the settings page, I want to have two mutually exclusive options so that when one is checked, the other is unchecked. Using the FAPI #states ...
0
votes
0answers
19 views

Field collection and jQuery LENGTH [closed]

I have a problem with a field collection and the attribute "Length" in jQuery. I have a field collection with 4 rows and when i wanna add a new row I got the error : Uncaught TypeError: Cannot ...
0
votes
2answers
21 views

Colorbox plugin installed but status report is not recognizing it [closed]

I have installed the Colorbox plugin version 5.1.14 in /sites/all/libraries/colorbox but on the status report page I get the following: You need to download the Colorbox plugin and extract the ...
0
votes
2answers
33 views

call js in html.tpl.php [closed]

I want to add smoothstate script to my pages. I have to call 2 files at the bottom just before closing body-tag. Smoothstate.js and Functions.js. How can I call those 2 js in my html.tpl.php ...
0
votes
3answers
70 views

How to add custom Jquery in drupal module? [closed]

I have created a custom module in drupal 7. The module creates a form for user and store the form's data into database. The module is working fine. But I want to add a custom jquery for the page. I ...
0
votes
1answer
54 views

Drupalgap exposed filter for data and select field

I spent all weekend trying to make this work, and couldn't figure it out. How do I create a views exposed filter for date and a text list on a given node? My setup - I have a view that is exposed as ...
1
vote
1answer
33 views

Put node url in href to all img tags with jquery

I have a drupal site and i want to put all nodes url to all img tags! With bellow code can do this but all img linked to the same post url in the main pages, because take the link of the final post ...
1
vote
1answer
36 views

Drupal-8 Css styles not working while included in .info.yml file

For some reason my theme cant find css/style.css in drupal 8. This is the .info.yml: name: Adminimal type: theme description: Drupal Administration Simplified. # version: VERSION # core: 8.x base ...
3
votes
2answers
112 views

Why do I need to use .live() in Drupal Behaviors?

I am trying to be a good boy and use Drupal Behaviors to manage my JavaScript. My understanding is that one of the advantages of using Behaviors is that it frees you from having to use .live() to bind ...
0
votes
1answer
27 views

Reset a page with multiple exposed filters

I have a view page which is the main page on my website. It is kind of a search using exposed filters. As I have many exposed filters I installed the module MEFIBS which allows me to split the exposed ...
1
vote
0answers
25 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 ...
0
votes
1answer
30 views

How to add Javascript in Drupal 7 with jQuery?

I am trying to provide the option that users be able to put comment under each paragraph. So at the end of the article, I have something like this: Comments for paragraph 1 /* here I show the ...
0
votes
1answer
19 views

Creating item library, allowing user to make selections and publish to another page [on hold]

Above is a rough MS paint concept I banged out to illustrate what I'm trying to do. I need to create a library of items, which have pictures, descriptions, names, etc. This library will be ...
1
vote
1answer
31 views

How to use photoswipe script in Drupal 7

I want to use photoswipe script on my site to preview images. I downloaded the script, copied two JS files code-photoswipe-1.0.11.min.js and simple-inheritance.min.js. Include them in a file ...
1
vote
1answer
51 views

advagg drupal module breaking my js file

I am using advagg module to improve my website performance and I also using date picker jquery UI function for date functionality. I have datePicker intialization $( "#datepicker" ).datepicker(); . ...
0
votes
1answer
41 views

How can I include a custom JavaScript file such that it can access and bind events to DOM elements?

This is my first time writing custom JavaScript for Drupal, and at the moment I am attempting to bind onClick events to buttons within a block generated by a view, but I suspect I am approaching this ...
1
vote
1answer
117 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 ...
0
votes
0answers
42 views

Writing to the database via a jQuery toggle button?

I am using this jQuery plugin to render a toggle button in a block. When the button is toggled off/on I want to write to a databse table. The code below is working. When I toggle the button I can see ...
0
votes
1answer
39 views

Submit few forms in Drupal 7

I try to add Poll-voting to my website, on page I addet 5 votings forms, I try to make submission of all 5 forms by one click instead of 5 clicking. I wrote this script : <script ...
0
votes
0answers
14 views

Is there a jQuery container selector for CCK fields?

I'm using a Drupal module called FitVids, which makes iframe videos and images responsive. But i'm also using the YouTube Field module and the fitvids module is distorting the YouTube Field module's ...
0
votes
0answers
10 views

when i onclick radio button then it's value should display in textfield [duplicate]

here i have two radio buttons radio button "One" and radio button "Two", when i click/check on radio button "One" then then it's value should display in textfield of "Display". ...
0
votes
1answer
72 views

when i onclick radio button then it's 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 then it's value should display in textfield of "Display". Code: function ...
0
votes
0answers
35 views

How to check in ajaxSuccess function if specific dom element has a particular class?

I have a view with two tabs. Basically, it is a view with a map of events on it and attached display to the map which lists the events. The view has an exposed filter which allows searching by ...
0
votes
0answers
26 views

jquery multi doesn't work for IE

I have a jquery plugin which requires jquery 1.7 and up but the site uses a lower version. Originally, I fixed the issue by adding this in the view alter ...
0
votes
0answers
41 views

Drupal custom form with AJAX and javascript event

I have a custom form that is displayed in a custom block. That block is a popup div. When a user fills the form successfully it's displaying success message. I want to attach a jQuery that will ...
0
votes
2answers
38 views

drupal_add_js weight

I've written a javascript that for some reason whenever I run it, it removes any hover events. Since I am running my site with nice menus I would like to run my script as high up in the $script array ...
0
votes
1answer
29 views

Sub Menu's are not coming under main menu

I am using this code to fetch menu's in drupal. I have given Home as parent menu and other are sub menu's like submenu1, submenu2 etc. But in front end they are not coming under Home menu. Only Home ...
0
votes
1answer
24 views

Ajax Request Failing

I've got a perplexing issue which has left me quite confused. I've got a form which has a link on it and when the user clicks the link it is supposed to open up an AJAX popup form and display some ...
0
votes
0answers
35 views

Adding form elements with jquery to a drupal form

I have a recipe form under node. Up until now, I had a button that would add another ingredient textfield by updating that section of the form with an ajax call. I can no longer do this. Now I have ...
0
votes
0answers
34 views

Show content of custom password field on mouseover

I need to hide a custom password field content and display it when a user needs to see and copy it. Using Password Field module is one way to go. But then Password Toggle module doesn't seem to ...
3
votes
3answers
183 views

How to stop the jquery element being added on ajax requests

I've added a toggle for my superfish menu, it works fine but for every ajax load or colorbox trigger the span is created multiple times. How to fix it??? (function ($){ Drupal.behaviors.customjs = { ...
1
vote
0answers
26 views

Drag and drop between two lists

When the user creates a blog entry, I want the user to be able to make some selection from a listbox. Therefore I want it to be a function where I drag and drop between one prefilled listbox (where ...
0
votes
1answer
43 views

Apply condition between two fields in drupal 7 by using JQuery

This is updated JQuery code I have created condition between two fields in drupal 7 i.e. If we select item from first field then as per there selected item, some items of second field is going to ...
2
votes
1answer
94 views

Internal/External JS don't work with Drupal, but works fine in static HTML/JSFiddle

Continued from here Applied JS to Drupal theme doesn't work correctly, but it works fine outside Drupal Working JSFiddle: http://jsfiddle.net/tbq8eo8b/10/ (it calculates total, in Drupal it ...
0
votes
1answer
29 views

Applied JS to Drupal theme doesn't work correctly, but it works fine outside Drupal

Applied this JS http://jsfiddle.net/tbq8eo8b/10/ to webforms. As you can see in fiddle, it calculates total amount. When in Drupal, it gives 0 no matter what amounts you select, it always prints 0. ...
0
votes
0answers
29 views

JS: Handling click event on element created by another module's JS

I've got two modules, one of which handles a button which makes all menus retract from sight, and another which handles a cycling background gallery. I'd like to switch from a "blurred" to a regular ...
0
votes
2answers
47 views

Content type or web form(creating own form using hooks) Which one is best way of collecting input from user? [closed]

I am new to Drupal and learning is in progress. I know about content types and creating webforms using hooks. Now I want to collect data from user and store it to db and view it later (easily I can do ...
0
votes
1answer
30 views

Why Cant add a class to an element by jquery [closed]

In the page.tpl.php I have some elements like <div class="play"></div> I have linked js file to the page and it is correctly works since all functions operate based on click ...
0
votes
1answer
270 views

Jquery.on method returns undefined is not a function

My goal was to create a simple button which once clicked would hide/show a navigational menu, and change the footer's padding alternatively, I'd have used toggle if not for the latter condition. ...
0
votes
3answers
118 views

How to implement jQuery Accordion for a Menu?

I'm looking to implement something like the Accordion Menu module, but unfortunately that module has issues with Menu Block and other modules... so what's the best way to implement the jQuery ...
0
votes
0answers
20 views

All my Js are called in the body, how can I fix that situation?

I a have a drupal 6 website to fix. All the scripts are called in the body, even with the scope value set to "header" or "footer" in the drupal_add_js function. It's a problem because some script are ...