All Questions
Tagged with 7 javascript
995 questions
0
votes
1
answer
524
views
Confirmation pop up on login submit
I have built a site using drupal 7.41. I have added the login form by adding this line in my page.tpl.php "print render($page['login_container']);".
When user click on the login button I want to show ...
0
votes
1
answer
1k
views
Include Lead Forensics code in all pages
I'm trying to include the tracking code Lead Forensics gave me. The code is:
<script type="text/javascript" src="http://www.path-trail.com/js/11111.js"></script>
<noscript><img ...
4
votes
2
answers
3k
views
How can I create an image gallery?
Currently I am running in D7 with the following modules:
Media 7.x-2.0
Views 7.x-3.7
Colorbox 7.x-2.4
I am trying to create an image gallery using these modules with the following steps. Please ...
0
votes
1
answer
1k
views
View field with JavaScript code in it
I have content type which has text field. Each node has its own javascript code which is set in to the text field. Text field is PHP Code format.
When I add this field to Views block site load ONLY ...
0
votes
1
answer
1k
views
Using SweetAlert with preventDefault()
I have an event on a form submit.
I set preventDefault() to stop the form submitting then pop SweetAlert with a confirmation callback. If they decide to go ahead, it POSTs the form to Drupal.
It doesn'...
1
vote
1
answer
593
views
Can 1 FullCalendar show dates from more than one content type?
I want to show "dates" and "Board Meetings" on my FullCalendar. How?
Background info:
In D7 I created a Calendar using the wizard, which shows titles and dates/times of events that I create using a ...
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 ...
0
votes
1
answer
1k
views
Fullcalendar is putting my events into the "all-day" category
I'm doing some stuff with fullcalendar and views that, more or less, is working. In particular, a month view properly shows a set of events on the day in which they're scheduled. However, when I ...
1
vote
1
answer
531
views
How to include XML file in node for js map rendering?
I have a clickable map that uses js, css and xml to display. I previously was provided solutions in a previous thread How do I implement a clickable JavaScript map? using drupal_add_css() and ...
0
votes
2
answers
636
views
Save form when user refreshes page from browser or click on any anchor tag inside page
I have made a form in drupal.
What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through ...
0
votes
1
answer
650
views
jcarousel not working on block?
1) Place this module directory in your modules folder (this will usually be
"sites/all/modules/").
2) Enable the module within your Drupal site at Administer -> Site Building ->
Modules (admin/...
0
votes
1
answer
604
views
How to open jquery dialog on menu click
I would like to open a jquery dialog that asks a question before taking the user to the desired page (ie do some page set-up before they get there). The catch here is that I would like to open the ...
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 ...
1
vote
2
answers
914
views
Add conditional javascript from CDN (external library)
I know it has been discussed here several times, but:
Is there a way to include conditional JS from CDN in the head section?
My goal is to somehow use drupal_add_js, external. That will stick in the ...
1
vote
1
answer
507
views
Qiuck tabs shifts the Openlayers map background layer
Im displaying the list of locations (address and map Openlayers + Geofield) using views. There is no problems when displaying view in ordinary way, but when the view is displayed inside quicktabs the ...
0
votes
1
answer
859
views
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 ...
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
3k
views
How to use an external jQuery plugin with Drupal's no-conflict jQuery
I'm using drupal_add_js() to load some external js:
drupal_add_js('http://jquery-accordion.googlecode.com/svn/trunk/jquery.accordion.js', 'external');
This produces 'TypeError: $ is not a function' ...
3
votes
1
answer
3k
views
Why does jQuery slideToggle revert back to initial hidden state after running?
I have a Superfish 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 ...
1
vote
1
answer
730
views
Drupal EU Cookie Compliance module conflict with theme JQuery
When I first installed the module, it'd only appear in admin pages.
After some investigation, I discovered the cause was some sort of conflict with my themes jquery: jquery-1.11.2.min.js.
If I ...
0
votes
1
answer
927
views
Form validate without submit action
I'm developing a site that it will use Services for the CRUD operations and ANGULARJS for the comunication frontend <-> backend.
Now when I want to insert a new content of content type FOO I will ...
2
votes
2
answers
2k
views
Trigger jQuery "add more" multiple times
I have a form that I am filling with default values in hook_form_alter. Some of the fields are in a in a field group and I need to trigger the "add more" button using code.
I figured out how to send ...
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 ...
3
votes
3
answers
1k
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 ...
0
votes
2
answers
1k
views
How to use drupal_add_library with a module?
I'm new to Drupal and don't really understand how to set up drupal_add_library.
I've made a simple module that links out to a .js file. However, this .js file depends on a couple of generic functions....
0
votes
2
answers
650
views
How to attach external js to Drupal.behaviours
If we write js code in Drupal.behaviours like below
(function($) {
Drupal.behaviors.my_module = {
attach : function(context, settings) {
}
};
})(jQuery);
that code will be execute multiple ...
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 ...
0
votes
1
answer
537
views
How to add onBlur attribute to ZIP code field in Address Field
In order to control the input format in the ZIP code field in the dynamic address fields provided by the Address Field module (I use it in Drupal Commerce) I need to add the attributes onKeyUp and ...
1
vote
1
answer
2k
views
How do I display, in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from 'title' attribute
I am trying to display in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from image 'title' attribute).
The colorbox is opened when an image is clicked.
Here ...
4
votes
2
answers
4k
views
How to trigger a form and pass variables to $form_state with jQuery?
What is the way to trigger a Drupal form via JavaScript, and pass new values to $form_state while doing so?
I have a main form, which has an element that triggers a jQuery UI dialog with a form in it. ...
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
535
views
#states on exposed filter form
I have a #states on the exposed filter form as follow:
If field_a == 'b' then field_b show, field_c hidden;
else if field_a == 'c' then field_c show, field_b hidden;
All fields here are Select ...
6
votes
1
answer
1k
views
How to add multiple products to cart at the same time with attributes
I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / ...
0
votes
1
answer
693
views
How to reference external JS callback in custom module
So I apologize if I mess the terms here up, I'm relatively new to using jQuery in Drupal. I'm trying to implement a custom Google Map application with the V3 API. When I started mocking the module up ...
1
vote
1
answer
410
views
How to link an image with a PDF?
Actually, I have a content type with 2 fields, image field (multiple) which will contain some pictures and an attachment field (accept only one file) which is file of type PDF.
I have a view where I ...
1
vote
1
answer
420
views
Popup map block
I'm trying to get a map to appear in a modal but haven't worked out a solution yet.
I have a list of items and I would like a map with their locations to appear when I click a 'view map' button.
I'm ...
1
vote
2
answers
2k
views
How to add validation on 'next' button using fieldgroup module
I am creating a multiple page registration form using the field group module and
I want to add validation on 'next' and 'previous' buttons.
If the first page's field is empty, the user can not go ...
1
vote
2
answers
468
views
Hide a div on webform submission using ajax
I am new to drupal i am using webform ajax module to submit my webform , its submiting values properly after validating them , but along with this i want to hide a div also on submit . what is the ...
0
votes
2
answers
634
views
Modal/dialog box
This sound like a really dumb question, but for the life of me I cannot find something that works.
I want to trigger a modal/dialog box for some basic content. Its just HTML, not the login page or ...
20
votes
2
answers
24k
views
Add external javascripts
Is it possible to add external javascripts directly into the .info file of a theme?
e.g scripts[] = http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js
0
votes
2
answers
163
views
How do I clear settings from the Drupal object?
I have a module, which renders an AJAX form, which passes data to a script via drupal_add_js and stores it in the settings property of the Drupal object. My problem is that I cannot seem to remove old ...
0
votes
3
answers
582
views
Is there a reliable way to show Drupal messages from JavaScript?
I need to show status messages (the kind typically shown by drupal_set_message()) in my module's JavaScript code. How can I do this reliably, such that the theme and placement of the messages remains ...
0
votes
1
answer
199
views
How can I add an external/third party library with type = 'module' using drupal_add_js()?
drupal_add_js('path_to_external_JS_file_on_CDN', [
'every_page' => TRUE,
'type' => 'external',
'defer' => 'defer',
'attributes' => [
'async' => true,
'type' =...
0
votes
0
answers
45
views
Use javascript code in a specific div of the webform page
I have a website that was set up using Webforms with page breaks. So on the same URL, there are multiple "pages" and div blocks on each page, with a progress bar on top so you know what &...
12
votes
2
answers
7k
views
Right way to add JS and CSS to node/edit and other forms
I am making a site with a lots of JS, and I am wondering where I should put the JS code. Optimally I would like to keep the JS with each module and not the theme layer. Some content could be exposed ...
3
votes
3
answers
1k
views
Add JavaScript to a node form
I'm trying to add a custom JavaScript file to the forms to create or edit a node.
I've tried mythemename_preprocess_page(), hook_form_alter() and theme_content_type_node_form(). They seem to pick up ...
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 ...
0
votes
2
answers
6k
views
Simple Back button?
I was using window.history.back() ,
<a href="#" onclick="goBack()">Back</a>
and
<script>
function goBack(){
window.history.back();
}
</script>
but it is not working in d7
0
votes
1
answer
158
views
'Change email' form on custom page
I would basically like to display the form/field that is used for changing the user's email address on a custom page with my own layout and things.
Ideally, I would like to make it so that if ...
2
votes
2
answers
5k
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, ...