25
votes
How to pass variable to external js in magento 2
There are two ways to include javascript from the template in Magento 2: the <script type="text/x-magento-init"> and the data-mage-init attribute. Either way can be used to pass data to the ...
7
votes
Custom form Validation - Magento
There are a lot of classes for data validation:
'validate-no-html-tags' => 'HTML tags are not allowed'
'validate-select' => 'Please select an option.'
'required-entry' ...
5
votes
Accepted
Modify existing prototype js validation method
Here is how you can either override an existing validation method or create your own. There is only one js snippet below bc its the exact same procedure for either one. In my example, I override an ...
4
votes
How to extend admin js in magento 2 by mixins
I am curious to know why would Magento won't allow using mixins on such file... any quick explanation about it?
4
votes
Accepted
How to extend admin js in magento 2 by mixins
You may not use js mixin for the particular js file you try to override (i.e /vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js). Also, your require-config.js declaration is ...
4
votes
magento 1.9.3.2 backend reset password error
I just fixed the problem for my project. For me this looks like strange behaviour of the return Content-type header.
My solution is just to patch "app/design/adminhtml/default/default/template/...
3
votes
Accepted
Dynamic text in prototype field validation
I know it's a bit backwards, but you can access the Validation object inside your validation method and then modify it dynamically while you run your test. What you can do is for example, add a new ...
2
votes
Accepted
How can i upload a file using prototype js ajax call
You cannot sent files via AJAX calls (at least not on all browsers), but you can simulate an AJAX call and upload a file without a page refresh.
You can take a look at how the category image is ...
2
votes
Magento1 Feefo widget js conflict with prototype.js
We had the same error. Seems Feefo is not compatible with the default prototype 1.7 which is included in Magento v1. You could show the widgets using iframes (this may scupper the SEO potential) or ...
2
votes
How to extend admin js in magento 2 by mixins
Actually, there is another way to extend a class method that worked for me. Example:
scripts-mixins.js
define([], function () {
'use strict';
if (typeof AdminOrder !== "undefined") {...
2
votes
Accepted
What stopObserving() function is used for - Magento 1.9
Say you have a form input where you are observing the keyUp event. If you wanted to no longer listen to this event, maybe because the value passes validation or is no longer required to validate due ...
1
vote
I want to override js function on shipping method section
skin/frontend/{package}/{theme}/js/opcheckout.js //shipping method
1
vote
I want to override js function on shipping method section
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 ...
1
vote
Ajax.Responders.register's onComplete Executes Before Ajax Complete
onSuccess is not available for Ajax.Responders http://api.prototypejs.org/ajax/Ajax/Responders/
You need to use onComplete and add some extra checks for url and response status
Your code can looks ...
1
vote
jQuery conflict in owlcarousel
If you use a variable $k, then all of your jQuery calls would be with that object.
You can use below example of code. You have to modify according your requirements:
<script type="text/javascript"...
1
vote
Accepted
jQuery conflict in owlcarousel
You can add local copy of jquery after following line[skin/frontend/yourpackage/yourtheme/js/jquery.min.js]
<action method="addJs"><script>mage/translate.js</script></action>
<action ...
1
vote
Uncaught SyntaxError: return 32 - new Date(year, month - 1, 32).getDate();
I don't think you can call the getDate() method directly after the Date constructor.
I would replace:
return 32 - new Date(year, month - 1, 32).getDate();
With:
var myDate = new Date(year, month - ...
1
vote
Accepted
Jquery conflict with elastislide.js and prototype.js
If you use a variable $k, then all of your jQuery calls would be with that object.
You can use below code:
<script type="text/javascript">
$k = jQuery.noConflict();
$k(document).ready(function(...
1
vote
Accepted
How to scroll to first error in Magento 1.9 product page?
Edit product template: /app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/catalog/product/view.phtml
find:
<script type="text/javascript">
//<![CDATA[
var ...
1
vote
Dynamic text in prototype field validation
The easiest way to do this is to add the custom validation in the phtml
<div class="validation-advice" id="field-required-entry-[inputID]" style="display:none;">Please enter a value for [...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
prototype-js × 109magento-1.9 × 40
javascript × 35
ajax × 20
jquery × 18
magento-1.7 × 13
validation × 10
magento-1.8 × 8
form-validation × 7
magento-enterprise × 6
onepage-checkout × 6
conflict × 6
magento2 × 5
checkout × 4
configurable-product × 3
error × 3
admin × 2
extensions × 2
frontend × 2
custom × 2
image × 2
forms × 2
requirejs × 2
php-5.4 × 2
ee-1.13 × 2