Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [jquery]

Denotes questions related to the use of jQuery library in Magento.

Filter by
Sorted by
Tagged with
1
vote
1answer
332 views

Trying to make layered navigation accordion style (with divs)

Trying to make this work but seems not having any effect... What am I doing wrong? With help from @Shyam I got the following working solution: <div id="narrow-by-list"> <?php $_filters =...
1
vote
2answers
1k views

Validation callback in magento2

var dataForm = jQuery('#form'); dataForm.mage('validation'); function submitForm(){ if (dataForm.valid()){ dataForm.submit(); } } Everything is working well what i ...
0
votes
1answer
2k views

Magento 2 form validation - accessing mage/validation/validation.js return values?

This is my first go at a Magento 2, so please bear with me. I want to add functionality that scrolls the page to an error message if a form does not pass validation. Currently, I am listening for a ...
7
votes
2answers
2k views

Add jQuery Datatables in magento 2

I am trying to use the jquery DataTables in magento-2 frontend using the requirejs. I can see the datables.min.js file in the net panel, but somehow it give the following error. My reuirejs-config....
0
votes
1answer
453 views

Loading Spin and Disable button in magento

I have this function which is called after the button was clicked, I would like to disable the button until the alert comes up and to show a Loading Spin while it is not finished processing the feed. ...
0
votes
3answers
2k views

remove item from minicart in magento 1.9x

i want to remove item from minicart but using custom jquery ui popup. here is the default code template/checkout/cart/minicart/default.phtml <?php if (!$this->isOnCheckoutPage()): ?&...
0
votes
1answer
55 views

Magento blocking a href in topmenu with javascript

This might sound somewhat confusing, but it seems Magento is blocking certain a href tags with javascript. Let me explain: In the topmenu, I have a few categories: - shirts - pants - hats - ...
1
vote
1answer
1k views

Magento 2 - jQuery validation custom error message

I have the following input that requires validation. When the remote method is failed, it displays an error message Please fix this field.. How can I customize this message? <input type="text" ...
1
vote
2answers
559 views

jquery min file not loading in the homepage in Magento 1.9 installation

Until yesterday this website has been working properly. Strangely now when this url http://solankitextileagency.com is loaded, I'm getting this error A script on this page may be busy, or it may ...
1
vote
1answer
71 views

Error after removing jQuery elevate [duplicate]

I removed the jQuery elevate script from my site using this in the local.xml: <catalog_product_view translate="label"> <reference name="head"> <action method="removeItem"&...
1
vote
1answer
596 views

Magento 2 - jQuery validation remote method

I'm developing a custom form with a username that require validation at server side to check if the username exists. How can I apply the remote method of jquery validation plugin in Magento 2?
1
vote
2answers
499 views

How to stop Javascript alert box from popping up on each page load?

I've been trying to create a popup for the Currency Selector on Magento. With some help I finally got this to working but it pops up on each page load. Maybe someone knowledgeable in javascript can ...
1
vote
3answers
7k views

How do I remove jQuery Conflict in prototype.js with 1.11.1.jquery.min.js

I have a conflict between jQuery and another library. I added the code below to the local.xml file as per answers found here. <?xml version="1.0"?> <layout> <default> ...
3
votes
2answers
4k views

On hover instead of 'click' for mini cart and top account buttons in Magento RWD theme

Where do i have to change the jQuery functionality to show the drop downs from the 'mini cart' and the 'top-account' on hover instead of click on the desktop versions? Thanks!
12
votes
1answer
6k views

magento2: how validation work in magento2

In magento1 we can check validation like this: var formToValidate = $('form-validate'); var validator = new Validation(formToValidate); if(validator.validate()) { // Here we can code ...
0
votes
0answers
58 views

How to check is jQuery available for my module?

Magento as far as I know have it already loaded but jQuery functions won't work in my module. What can I do with it ? How can I make sure I have an access to it ? I would like to avoid jQuery ...
0
votes
1answer
40 views

I am not able to Warp div tag through jquery Magento 1.9 [closed]

I am trying to insert div tag in the div.accordion-template just after each h1 tag. I have updated my below jquery code in app.js // Accordions var $accordion = $j('div.accordion-template'); $...
0
votes
1answer
778 views

How to create full url of store using jQuery in Magento 2?

I was facing one big issue to access base URL of store in custom module through jQuery object in magento 2. In PHP, generally it can obtain using $this->getUrl('module/controller/action'); but in ...
6
votes
2answers
3k views

How to wait until text/x-magento-init has loaded the options

It seems to me that text/x-magento-init returns options async: <script type="text/x-magento-init"> { "*": { "component": " <?php echo "test" ?> " } ...
1
vote
1answer
3k views

Magento2 $ is not a function when using flexslider

I just migrated from Magento 1.x to Magento 2. I setup Magento successfully, understood and used RequireJS as well. I was adding flexslider on my home page and got the error: $ is not a function ...
4
votes
1answer
2k views

How to Extend and initialize a JS Widget with Proper Custom Namespace / Replace Existing Widget

I want to modify the mage.catalogAddToCart JS widget of Magento 2. According to http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html I have to do a $.widget('foobar....
1
vote
1answer
122 views

Added duplicate td for existing table using jQuery

I am trying to add a td for existing table using jQuery. But it's adding duplicate. How to validate exactly to add the td. I have tried below code: <table> <thead> <tr> <th&...
0
votes
2answers
3k views

XMLHttpRequest cannot load

I am trying to integrate Open Weather API in my website, for this I have written some coding and it's working as expected in my local system. The same code is not working in Live. it's returning error ...
0
votes
1answer
3k views

How to extract/get a xml attribute values to display

I am trying to integrate open weather api in my application and I have invoked weather api and it's returned xml response. But when I am trying to get the values it's throwing error like unknown error....
0
votes
1answer
530 views

JQuery auto complete not working

I have some js that does an autocomplete: jQuery("#city").autocomplete({ source: "/route/to/countroller", minLength: 1, select: function( event, ui ) { if((typeof ui.item....
0
votes
2answers
900 views

Need jquery or javascript function to get round up value of input number [closed]

Following is my script which I am trying to find solution for it. But I actually this function return round of ANS: 2. Eg. If input value is greater than 2.01 then result will be 3. I know round ...
0
votes
1answer
28 views

Add a static/hardcoded price if textfield contains text

I have a textbox that is shown on some products so that people can type a name or word that they want engraved onto the item they are buying. Now my issue is if they type something in the textbox and ...
1
vote
1answer
413 views

Getting error on custom add to cart Magento

I am trying to submit custom add to cart on product page with configurable product options but i am getting error with that.My code looks like this : <script> jQuery("#submit").click(function (...
2
votes
1answer
409 views

Store locator JS not working

I'm trying to implement the https://github.com/googlemaps/js-store-locator into a website, however something really strange seems to occur. When I load the Jquery file <script src="<?php echo $...
1
vote
1answer
3k views

how to add custom validation to product options field?

I'm trying to add custom validation to the product option, I'm following the tutorial and here it says to add custom validation element to the attribute data-validate like data-validate="{required:...
0
votes
1answer
446 views

Magento 1.9 JS problem

I have a search autocomplete to search a products. If it works other modules are not working (banner slider, brand logo slider, product slider, sticky menu and sticky header). autocomplete has 2 js ...
0
votes
1answer
77 views

Mobile menu diagnosis?

My mobile menu just stopped working yesterday. This is a Multi-site install, and its only affecting one site. There has been no installs, no changes to the the site in a few weeks. There's no error ...
1
vote
0answers
572 views

Add a Datepicker in a Fancybox in Magento 2 [closed]

I added a Datepicker in an ajax fancybox. My Code is <script> require(['jquery','rbpopup','mage/calendar'], function($){ $('.fancyboxlive').fancybox({ type: 'ajax', ...
0
votes
1answer
419 views

Get javascript value without html or script tags

I'm trying to get a product id value inside a add to cart button. The below code works getting the value in an alert. <script type="text/javascript"> jQuery(document).ready(function(e) { ...
0
votes
2answers
72 views

Magneto2 Include custom JS in theme

I want to include custom js in my theme i put it in web/js path of theme F:\xampp\htdocs\magento2\app\design\frontend\GWtheme\gw\web\js\jquery.flexisel.js Then i created requirejs-config.js var ...
0
votes
0answers
693 views

Load more not working

Load more PRODUCT not working js <script type="text/javascript"> jQuery(document).ready(function() { jQuery.ias({ container : ".category-products", item : "ul....
0
votes
2answers
6k views

jQuery - redirect immediately when session is expired or destroyed

I have a simple question. How can i make an page immediately redirect to other page in example www.google.com when a specific session is expired or destroyed. Here is how i get an session in PHP: &...
1
vote
1answer
102 views

I get an error when triggering an action with a script

EDIT I'm still getting an error with repeated information on the page when I use the Direct Sctipt as outlined below. does anyone have any idea why this might be happening? ORIGINAL QUESTION I ...
1
vote
2answers
5k views

Remove Conflict between JQuery and Prototype.js in magento 1.9.1

I have included all the js library in page.xml of my magento. <action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action> <action method="...
0
votes
1answer
469 views

Create Drop-down menu in shopping Cart Page

In given link , http://liferaybangalore.com/index.php add one product to cart and go to VIEW CART , Above PROCEED TO CHECKOUT Button i want to add custome code for drop-down menus like(Children ...
2
votes
2answers
2k views

Magento 2: Checkout button on product page

Is there a way to add a 'Add to Cart and Checkout' button to the product page, so that the product is added to the cart and then takes the user straight to the checkout?
1
vote
2answers
3k views

jQuery not working in checkout page - Magento 2

I am customizing checkout page. I try set value in form field by using Jquery but did not work. for making test I will try to hide all input elements in checkout page such a simple task but did not ...
3
votes
1answer
1k views

Call to a member function getAccountNo() on null Magento 2

I'm extending shipping method section in checkout page, and it's showing well. But it's throwing error while clicking next button after filling shipping address and shipping method information in ...
0
votes
1answer
259 views

How to use Chosen in magento

I need to use Chosen in magento instead of "select " for multi select.I didn't find any thing about it. How should I add jquery for it. I am trying to solve Following issue
0
votes
3answers
3k views

Product zoom option is not working

Product page zoom option is not working, i have using js/ecommerceteam/cloud-zoom.1.0.2.js css/ecommerceteam/cloud-zoom.css My working website http://m.machinetoolsemart.com/ Product page http://...
0
votes
1answer
77 views

How to avoid js issue after installing new modules

Although var $j = jQuery.noConflict(); is included in the head, installing new module can make js problem in other 3rd-party module. How to avoid this?
4
votes
1answer
3k views

Unable to use jQuery

Alright, I am trying to do a very simple thing: use jQuery in my myScript.js file. I'm on Magento 1.9.0.1. The theme I am building is based on the built-in rwd theme, which by default loads jQuery 1....
3
votes
1answer
11k views

Magento undefined jquery

I've added jquery 1.8.2 to both my page.xml file and the corresponding directory.. however i am still getting multiple Uncaught ReferenceError: jQuery is not defined errors. Jquery no conflict has ...
0
votes
1answer
10k views

“TypeError: $(…).fancybox is not a function” mobile menu button wont work (trying to fix)

I'm getting an error using magento. I'm using this theme http://demo.magentech.com/themes/sm_igame/ The JavaScript error I get is TypeError: $(...).fancybox is not a function <anonymous&...
1
vote
1answer
541 views

Magento form validation

When using jquery .change on an input the event will only be fired when the input loses focus In my case, I need to make a call to the service (check if value is valid or empty) as soon as the input ...