Submit form via POST method, but lost left sidebar menu

Hello everyone,

I have a custom page in the admin area with a controller and its view. Moreover, I have a form in the view and sending data with POST method. After submitting the form, I got the results I want, but the left menu of cs-cart lost… disappears… Am I missing something?

Inside my controller, I do stuff such as UPDATE database and GET results…

Thank you for your time

Hello

Any screenshot?
Have you checked your browser inspector for any errors on the page? (CTRL-SHIFT-C)
Are you sure you have all the tags closed in your template?
Maybe the menu is somewhere at the bottom or is invisible due to unclosed html tags

Best regards
Robert

1 Like

Hello and sorry for the delay… I did not find any errors you mentioned neither in console log nor at HTML tags…
I have a simple form tag like this:

<form action="{""|fn_url}" method="POST" name="confirm_view_orders_form" id="confirm_view_orders_form" class="form-horizontal form-edit">....

and a submit button like this:
<input class="btn btn-primary cm-submit" type="submit" name="dispatch[my_dispatch.view_orders]" value="{__("da_suppliers_invoices_search_btn")}" />

All the above are inside the view tpl file. My goal is to submit this form and inside controller do stuff in this section:

if($_SERVER['REQUEST_METHOD'] == 'POST') {
     if($mode == "view_orders") {
          //do stuff
     }

}
am I right so far? My code is executed correctly inside POST method, but as I said the menu has gone… Am I missing something? Any ideas ?

screenshot here, if that helps:

the white space at the left, was the basic menu of cs-cart (the default one)… And this is only happens when I am using this POST method with my forms and so on… I do not want to use any redirect of something like this:

return array(CONTROLLER_STATUS_OK, "my_dispatch.view_orders");

because I am loosing the results… The rows you see at the end of the screenshot… Any guidance would be helpful!!

thanks in advance