I've been trying to make my button open a new tab, the same way my form is doing but I've discovered that window.open() doesn't work on POST requests. SO, is there any other way I can make my button open a new tab instead of opening in the parent tab?

enter image description here


I just needed to place the target="_blank" like so

<form id="annex" method="POST" target="_blank" action="checkbutton/index/display">
    <input name='monkey' type="hidden" value="<?= $block->getProduct()->getSku(); ?>"/>
    <button type="submit" class="action primary tocart" id="checkstores"><?=__('Check Stores')?></button>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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