Skip to main content
Magento

Return to Question

Commonmark migration
Source Link

##Update:

Update:

##Update:

Update:

updates
Source Link
Xenocide8998
  • 1.8k
  • 2
  • 20
  • 32

##Update:

I was able to get functions to work if i removed the requirejs wrapper and change $ to jQuery in components.js.

function checkFormValues(inputs, radio) {
 var empty = false;
 jQuery(inputs).each(function () {
 if (jQuery(this).val() == '') {
 empty = true;
 return false;
 }
 });
 jQuery.each(radio, function(index, value) {
 if (!jQuery("input[name='" + value + "']:checked").val()) {
 empty = true;
 }
 });
 return empty;
}
function checkEnableSubmit(inputs, radio, button) {
 if (checkFormValues(inputs, radio)) {
 jQuery(button).attr('disabled', 'disabled');
 } else {
 jQuery(button).removeAttr('disabled');
 }
}

Should I not use requirejs wrapper for any shared functions or libraries?

##Update:

I was able to get functions to work if i removed the requirejs wrapper and change $ to jQuery in components.js.

function checkFormValues(inputs, radio) {
 var empty = false;
 jQuery(inputs).each(function () {
 if (jQuery(this).val() == '') {
 empty = true;
 return false;
 }
 });
 jQuery.each(radio, function(index, value) {
 if (!jQuery("input[name='" + value + "']:checked").val()) {
 empty = true;
 }
 });
 return empty;
}
function checkEnableSubmit(inputs, radio, button) {
 if (checkFormValues(inputs, radio)) {
 jQuery(button).attr('disabled', 'disabled');
 } else {
 jQuery(button).removeAttr('disabled');
 }
}

Should I not use requirejs wrapper for any shared functions or libraries?

edited title
Link
Xenocide8998
  • 1.8k
  • 2
  • 20
  • 32

magento 2: reference js function not working from jstemplate file

Source Link
Xenocide8998
  • 1.8k
  • 2
  • 20
  • 32
Loading
default

AltStyle によって変換されたページ (->オリジナル) /