Skip to content
Snippets Groups Projects
Commit 56804b23 authored by Partica, Cristian's avatar Partica, Cristian
Browse files

MAGETWO-54785: [GitHub] State/Province field doesn't show as required on the...

MAGETWO-54785: [GitHub] State/Province field doesn't show as required on the add new address page. #5279

- fixing logic for mandatory labels and error cleanup when switching countries and updating region
parent 3be18f35
Branches
No related merge requests found
...@@ -122,8 +122,13 @@ define([ ...@@ -122,8 +122,13 @@ define([
this.options.form = $(this.options.form); this.options.form = $(this.options.form);
this.options.form && this.options.form.data('validation') && this.options.form.validation('clearError', this.options.form && this.options.form.data('validator') && this.options.form.validation('clearError',
this.options.regionListId, this.options.regionInputId, this.options.postcodeId); this.options.regionListId, this.options.regionInputId, this.options.postcodeId);
// Clean up errors on region & zip fix
$(this.options.regionInputId).removeClass('mage-error').parent().find('[generated]').remove();
$(this.options.regionListId).removeClass('mage-error').parent().find('[generated]').remove();
$(this.options.postcodeId).removeClass('mage-error').parent().find('[generated]').remove();
} }
}, },
/** /**
...@@ -182,11 +187,12 @@ define([ ...@@ -182,11 +187,12 @@ define([
if (!this.options.optionalRegionAllowed) { if (!this.options.optionalRegionAllowed) {
regionInput.attr('disabled', 'disabled'); regionInput.attr('disabled', 'disabled');
} }
requiredLabel.removeClass('required');
regionInput.removeClass('required-entry')
} }
regionList.removeClass('required-entry').hide(); regionList.removeClass('required-entry').hide();
regionInput.show(); regionInput.show();
requiredLabel.removeClass('required');
label.attr('for', regionInput.attr('id')); label.attr('for', regionInput.attr('id'));
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment