Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
save.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php if ($form): ?>
11 <?= $form->toHtml() ?>
12 
13 <script>
14 require([
15  "jquery",
16  "mage/mage"
17 ], function($){
18 
19  $('#<?= /* @escapeNotVerified */ $form->getForm()->getId() ?>').mage('form').mage('validation');
20 
21  $(document).ready(function () {
22  'use strict';
23 
24  $('.field-zip_from').addClass('ignore-validate');
25  $('.field-zip_to').addClass('ignore-validate');
26 
27  $('#zip_is_range').on('change.zipRange', function(){
28 
29  var elem = $(this),
30  zipFrom =$('.field-zip_from'),
31  zipTo =$('.field-zip_to'),
32  zipCode =$('.field-tax_postcode');
33 
34  if (elem.is(':checked')) {
35  zipCode.addClass('hidden').addClass('ignore-validate');
36  zipFrom.removeClass('hidden').removeClass('ignore-validate');
37  zipTo.removeClass('hidden').removeClass('ignore-validate');
38 
39  } else {
40  zipCode.removeClass('hidden').removeClass('ignore-validate');
41  zipFrom.addClass('hidden').addClass('ignore-validate');
42  zipTo.addClass('hidden').addClass('ignore-validate');
43  }
44 
45  });
46  });
47 
48 });
49 </script>
50 <?php endif; ?>
endif
Definition: save.phtml:24
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
Definition: edit.phtml:164