Form which i getting from ajax not working in admin panel Magento 2Why does my ajax add to cart not push the right product to the cart?Mass action in the grid in tab redirects to dashboard in magento2Magento 2 Add new field to Magento_User admin formData save in magento 2.1 product formMagento 2: How to submit form on checkbox click?Magento 2 - Send processed data from Controller to PHTMLForm is not displayed on panel admin Magento 2how to add category using factory method not object managerCall block action using AjaxHow to create custom form in Magento 2.2.3

Why are Hobbits so fond of mushrooms?

Who Can Help Retag This?

What's a moment that's more impactful on a reread called?

How can an advanced civilization forget how to manufacture its technology?

Bishop game - python

<schwitz>, <zwinker> etc. Does German always use 2nd Person Singular Imperative verbs for emoticons? If so, why?

As the Dungeon Master, how do I handle a player that insists on a specific class when I already know that choice will cause issues?

Does Google Maps take into account hills/inclines for route times?

Is Trump personally blocking people on Twitter?

How can I deal with a player trying to insert real-world mythology into my homebrew setting?

How can one write good dialogue in a story without sounding wooden?

Correct use of ergeben?

Filtering fine silt/mud from water (not necessarily bacteria etc.)

Supporting developers who insist on using their pet language

Where is the USB2 OTG port on the RPi 4 Model B located?

Is an acid a salt or not?

How do I take a fraction to a negative power?

Why is dry soil hydrophobic? Bad gardener paradox

Why did the Japanese attack the Aleutians at the same time as Midway?

How do I determine whether a permit is required for a new gas line?

The monorail explodes before I can get on it

Why isn't there research to build a standard lunar, or Martian mobility platform?

What is temperature on a quantum level

Are there any double stars that I can actually see orbit each other?



Form which i getting from ajax not working in admin panel Magento 2


Why does my ajax add to cart not push the right product to the cart?Mass action in the grid in tab redirects to dashboard in magento2Magento 2 Add new field to Magento_User admin formData save in magento 2.1 product formMagento 2: How to submit form on checkbox click?Magento 2 - Send processed data from Controller to PHTMLForm is not displayed on panel admin Magento 2how to add category using factory method not object managerCall block action using AjaxHow to create custom form in Magento 2.2.3






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a form in the content of the ajax response, but when I submit the form, the action does'nt work (redirected to dashboard), form action same page, but when I use this form without Ajax, then it works fine, thanks for help



<form class="wrapper" method="GET" name="go_to_print_page" id="go_to_print_page" action="<?php echo $createAction; ?>">
<input name="send_customer_id" class="send_customer_id" type="hidden" value="<?php echo $customerId; ?>" />
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
<button type="submit" class="submit"><?php echo __("View");?></button>
</form>


AJAX REQUEST



 jQuery.ajax({
url: url,
type: "POST",
data: createdFrom:createdFrom,createdTo:createdTo,
showLoader: false,
cache: false,
success: function(response)
jQuery('#printTable_wrapper').html(response.output);
jQuery('#printTable_wrapper').trigger('contentUpdated');
);









share|improve this question






















  • $createAction how you create this url?

    – Sohel Rana
    Jul 4 at 13:56











  • $createMyAction = $baseUrl.'/cart/printcartinfo/';

    – Robinio Tor
    Jul 4 at 13:58


















0















I have a form in the content of the ajax response, but when I submit the form, the action does'nt work (redirected to dashboard), form action same page, but when I use this form without Ajax, then it works fine, thanks for help



<form class="wrapper" method="GET" name="go_to_print_page" id="go_to_print_page" action="<?php echo $createAction; ?>">
<input name="send_customer_id" class="send_customer_id" type="hidden" value="<?php echo $customerId; ?>" />
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
<button type="submit" class="submit"><?php echo __("View");?></button>
</form>


AJAX REQUEST



 jQuery.ajax({
url: url,
type: "POST",
data: createdFrom:createdFrom,createdTo:createdTo,
showLoader: false,
cache: false,
success: function(response)
jQuery('#printTable_wrapper').html(response.output);
jQuery('#printTable_wrapper').trigger('contentUpdated');
);









share|improve this question






















  • $createAction how you create this url?

    – Sohel Rana
    Jul 4 at 13:56











  • $createMyAction = $baseUrl.'/cart/printcartinfo/';

    – Robinio Tor
    Jul 4 at 13:58














0












0








0








I have a form in the content of the ajax response, but when I submit the form, the action does'nt work (redirected to dashboard), form action same page, but when I use this form without Ajax, then it works fine, thanks for help



<form class="wrapper" method="GET" name="go_to_print_page" id="go_to_print_page" action="<?php echo $createAction; ?>">
<input name="send_customer_id" class="send_customer_id" type="hidden" value="<?php echo $customerId; ?>" />
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
<button type="submit" class="submit"><?php echo __("View");?></button>
</form>


AJAX REQUEST



 jQuery.ajax({
url: url,
type: "POST",
data: createdFrom:createdFrom,createdTo:createdTo,
showLoader: false,
cache: false,
success: function(response)
jQuery('#printTable_wrapper').html(response.output);
jQuery('#printTable_wrapper').trigger('contentUpdated');
);









share|improve this question














I have a form in the content of the ajax response, but when I submit the form, the action does'nt work (redirected to dashboard), form action same page, but when I use this form without Ajax, then it works fine, thanks for help



<form class="wrapper" method="GET" name="go_to_print_page" id="go_to_print_page" action="<?php echo $createAction; ?>">
<input name="send_customer_id" class="send_customer_id" type="hidden" value="<?php echo $customerId; ?>" />
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
<button type="submit" class="submit"><?php echo __("View");?></button>
</form>


AJAX REQUEST



 jQuery.ajax({
url: url,
type: "POST",
data: createdFrom:createdFrom,createdTo:createdTo,
showLoader: false,
cache: false,
success: function(response)
jQuery('#printTable_wrapper').html(response.output);
jQuery('#printTable_wrapper').trigger('contentUpdated');
);






magento2 ajax admin-panel






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 4 at 13:43









Robinio TorRobinio Tor

35311 bronze badges




35311 bronze badges












  • $createAction how you create this url?

    – Sohel Rana
    Jul 4 at 13:56











  • $createMyAction = $baseUrl.'/cart/printcartinfo/';

    – Robinio Tor
    Jul 4 at 13:58


















  • $createAction how you create this url?

    – Sohel Rana
    Jul 4 at 13:56











  • $createMyAction = $baseUrl.'/cart/printcartinfo/';

    – Robinio Tor
    Jul 4 at 13:58

















$createAction how you create this url?

– Sohel Rana
Jul 4 at 13:56





$createAction how you create this url?

– Sohel Rana
Jul 4 at 13:56













$createMyAction = $baseUrl.'/cart/printcartinfo/';

– Robinio Tor
Jul 4 at 13:58






$createMyAction = $baseUrl.'/cart/printcartinfo/';

– Robinio Tor
Jul 4 at 13:58











1 Answer
1






active

oldest

votes


















0














Your URL is wrong. Try following way so you can get correct URL for admin action:



$block->getUrl('cart/printcartinfo');





share|improve this answer

























    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%2f280840%2fform-which-i-getting-from-ajax-not-working-in-admin-panel-magento-2%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Your URL is wrong. Try following way so you can get correct URL for admin action:



    $block->getUrl('cart/printcartinfo');





    share|improve this answer



























      0














      Your URL is wrong. Try following way so you can get correct URL for admin action:



      $block->getUrl('cart/printcartinfo');





      share|improve this answer

























        0












        0








        0







        Your URL is wrong. Try following way so you can get correct URL for admin action:



        $block->getUrl('cart/printcartinfo');





        share|improve this answer













        Your URL is wrong. Try following way so you can get correct URL for admin action:



        $block->getUrl('cart/printcartinfo');






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 4 at 14:31









        Sohel RanaSohel Rana

        24.9k3 gold badges47 silver badges65 bronze badges




        24.9k3 gold badges47 silver badges65 bronze badges



























            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%2f280840%2fform-which-i-getting-from-ajax-not-working-in-admin-panel-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

            Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

            Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

            Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림