Customize Account setting form in Magento 2












0















In Magento 2, the previous Account Setting edit form has a different layout, like for changing password user has to select the checkbox and then text boxes for password updates pop up,



I am changing that layout



enter image description here



So I removed all the checkboxes, and put change password in the different form.
and also I included first name, last name, email address, gender, dob in password form and display it to none.



The issue is, password update doesn't work, On digging up I found the script code in edit form phtml



<script type="text/x-magento-init">
{
"[data-role=change-email], [data-role=change-password]": {
"changeEmailPassword": {
"titleChangeEmail": "<?= $block->escapeJs($block->escapeHtml(__('Change Email'))) ?>",
"titleChangePassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Password'))) ?>",
"titleChangeEmailAndPassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Email and Password'))) ?>"
}
},
"[data-container=new-password]": {
"passwordStrengthIndicator": {
"formSelector": "form.form-edit-account"
}
}
}




Code for checkboxes which I removed



 <div class="field choice">
<input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" />
<label class="label" for="change-email"><span><?= $block->escapeHtml(__('Change Email')) ?></span></label>
</div>
<div class="field choice">
<input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>"<?php if ($block->getChangePassword()): ?> checked="checked"<?php endif; ?> class="checkbox" />
<label class="label" for="change-password"><span><?= $block->escapeHtml(__('Change Password')) ?></span></label>
</div>


So that's clear script is linked to those checkboxes, as it assigns some kind of listener to [data-role=change-email] and [data-role=change-password],
How can I change it to so that my Update Password will work?



I even tried adding those checkboxes and displayed it none still it didn't work.









share



























    0















    In Magento 2, the previous Account Setting edit form has a different layout, like for changing password user has to select the checkbox and then text boxes for password updates pop up,



    I am changing that layout



    enter image description here



    So I removed all the checkboxes, and put change password in the different form.
    and also I included first name, last name, email address, gender, dob in password form and display it to none.



    The issue is, password update doesn't work, On digging up I found the script code in edit form phtml



    <script type="text/x-magento-init">
    {
    "[data-role=change-email], [data-role=change-password]": {
    "changeEmailPassword": {
    "titleChangeEmail": "<?= $block->escapeJs($block->escapeHtml(__('Change Email'))) ?>",
    "titleChangePassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Password'))) ?>",
    "titleChangeEmailAndPassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Email and Password'))) ?>"
    }
    },
    "[data-container=new-password]": {
    "passwordStrengthIndicator": {
    "formSelector": "form.form-edit-account"
    }
    }
    }




    Code for checkboxes which I removed



     <div class="field choice">
    <input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" />
    <label class="label" for="change-email"><span><?= $block->escapeHtml(__('Change Email')) ?></span></label>
    </div>
    <div class="field choice">
    <input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>"<?php if ($block->getChangePassword()): ?> checked="checked"<?php endif; ?> class="checkbox" />
    <label class="label" for="change-password"><span><?= $block->escapeHtml(__('Change Password')) ?></span></label>
    </div>


    So that's clear script is linked to those checkboxes, as it assigns some kind of listener to [data-role=change-email] and [data-role=change-password],
    How can I change it to so that my Update Password will work?



    I even tried adding those checkboxes and displayed it none still it didn't work.









    share

























      0












      0








      0








      In Magento 2, the previous Account Setting edit form has a different layout, like for changing password user has to select the checkbox and then text boxes for password updates pop up,



      I am changing that layout



      enter image description here



      So I removed all the checkboxes, and put change password in the different form.
      and also I included first name, last name, email address, gender, dob in password form and display it to none.



      The issue is, password update doesn't work, On digging up I found the script code in edit form phtml



      <script type="text/x-magento-init">
      {
      "[data-role=change-email], [data-role=change-password]": {
      "changeEmailPassword": {
      "titleChangeEmail": "<?= $block->escapeJs($block->escapeHtml(__('Change Email'))) ?>",
      "titleChangePassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Password'))) ?>",
      "titleChangeEmailAndPassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Email and Password'))) ?>"
      }
      },
      "[data-container=new-password]": {
      "passwordStrengthIndicator": {
      "formSelector": "form.form-edit-account"
      }
      }
      }




      Code for checkboxes which I removed



       <div class="field choice">
      <input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" />
      <label class="label" for="change-email"><span><?= $block->escapeHtml(__('Change Email')) ?></span></label>
      </div>
      <div class="field choice">
      <input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>"<?php if ($block->getChangePassword()): ?> checked="checked"<?php endif; ?> class="checkbox" />
      <label class="label" for="change-password"><span><?= $block->escapeHtml(__('Change Password')) ?></span></label>
      </div>


      So that's clear script is linked to those checkboxes, as it assigns some kind of listener to [data-role=change-email] and [data-role=change-password],
      How can I change it to so that my Update Password will work?



      I even tried adding those checkboxes and displayed it none still it didn't work.









      share














      In Magento 2, the previous Account Setting edit form has a different layout, like for changing password user has to select the checkbox and then text boxes for password updates pop up,



      I am changing that layout



      enter image description here



      So I removed all the checkboxes, and put change password in the different form.
      and also I included first name, last name, email address, gender, dob in password form and display it to none.



      The issue is, password update doesn't work, On digging up I found the script code in edit form phtml



      <script type="text/x-magento-init">
      {
      "[data-role=change-email], [data-role=change-password]": {
      "changeEmailPassword": {
      "titleChangeEmail": "<?= $block->escapeJs($block->escapeHtml(__('Change Email'))) ?>",
      "titleChangePassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Password'))) ?>",
      "titleChangeEmailAndPassword": "<?= $block->escapeJs($block->escapeHtml(__('Change Email and Password'))) ?>"
      }
      },
      "[data-container=new-password]": {
      "passwordStrengthIndicator": {
      "formSelector": "form.form-edit-account"
      }
      }
      }




      Code for checkboxes which I removed



       <div class="field choice">
      <input type="checkbox" name="change_email" id="change-email" data-role="change-email" value="1" title="<?= $block->escapeHtmlAttr(__('Change Email')) ?>" class="checkbox" />
      <label class="label" for="change-email"><span><?= $block->escapeHtml(__('Change Email')) ?></span></label>
      </div>
      <div class="field choice">
      <input type="checkbox" name="change_password" id="change-password" data-role="change-password" value="1" title="<?= $block->escapeHtmlAttr(__('Change Password')) ?>"<?php if ($block->getChangePassword()): ?> checked="checked"<?php endif; ?> class="checkbox" />
      <label class="label" for="change-password"><span><?= $block->escapeHtml(__('Change Password')) ?></span></label>
      </div>


      So that's clear script is linked to those checkboxes, as it assigns some kind of listener to [data-role=change-email] and [data-role=change-password],
      How can I change it to so that my Update Password will work?



      I even tried adding those checkboxes and displayed it none still it didn't work.







      magento2 javascript forms change-password





      share












      share










      share



      share










      asked 1 min ago









      summusummu

      558




      558






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f262749%2fcustomize-account-setting-form-in-magento-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f262749%2fcustomize-account-setting-form-in-magento-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What other Star Trek series did the main TNG cast show up in?

          Berlina muro

          Berlina aerponto