0

I have phtml file which has submit. I am going to submit with post mode. But get mode is working continuously. Why is the reason?

<form id="publication_reg_frm" method="POST" action="<?= $block->getUrl('customers/mypage/publicationcfrm'); ?>" data-mage-init='{"validation":{}}'>
  <?= /* @noEscape */ $block->getBlockHtml('formkey') ?>
  <div class="contents">
    <div class="contents_block">
      <div class="pan">
      </div>
   </div>
  </div>
  <input type="submit" />
</form>

2 Answers 2

1
  • Make sure that the form key is being properly validated on the server side. The line getBlockHtml('formkey') ?> is responsible for generating the form key input field. Verify that the form key value is being validated on the server side when the form is submitted.
  • Ensure that the URL 'customers/mypage/publicationcfrm' is pointing to the correct controller action in your Magento application. Double-check that the corresponding controller and action exist and are properly handling the form submission.
  • Check if there is any JavaScript code running on the page that might be interfering with the form submission. Make sure there are no JavaScript event handlers or functions modifying the form behavior or preventing the default form submission.
0

Try this code

<form id="publication_reg_frm" method="POST" action="customers/mypage/publicationcfrm" data-mage-init='{"validation":{}}'>
  <div class="contents">
    <div class="contents_block">
      <div class="pan">
      </div>
   </div>
  </div>
  <input type="submit" />
</form>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.