show a button on the same page after submitting another button - laravel

I want a button to appear on index.blade after another button is clicked on the same page.the second button returns results in index.blade too and i want to show the new button after these results come back.
what's the easiest way to do it in Laravel.
sorry I'm a beginner.

Related

How to pass data from one page model to another page model in fresh mvmm

I have used Fresh MVMM. I need to pass a data from one page model to another page model without using init and reverse init.
Eg: I have one toggle button in first content page.
I need to toggled the button based on the selection in second popup page without popup the second PopPopupPageModel.
ReverseInit is worked when popup the second PopPopupPageModel and can easily pass data.
But I need to toogled the button in first page without popup the second page.
Please help...

How to redirect a user to a previous page where the edit button was clicked

I have an index page where all the models are shown and when you click edit you go to edit page and after you change something you click update and you will be redirected to index, all fine there.
And now i have made a show view and in show view i made the same edit button to go to edit page and when you click update of course you will be redirected of to the index page and i don't want that. I want to redirect user to the page where the EDIT button was clicked.
How can i redirect users to the page where they actually clicked the edit button?
You can keep URL in session to go two pages back in Laravel:
$links = session->has('links') ? session('links') : []; // Get data from session
array_unshift($links, $_SERVER['REQUEST_URI']); // Add current URI to an array
session(compact('links')); // Save an array to session
Then you can go 2 pages back:
return redirect(session('links')[2]);
You can use:
return back();
It returns you to back as it is so obvious. You can research this and other helper functions here:
https://laravel.com/docs/5.3/helpers#method-back

Laravel : Create Show More Button using pagination

As the title says,
How would you create a "Show More" button using Laravel Paginate
$model->links("pagination::simple");
doesn't do the trick because it should only show next button.
I understand that you want to show all results when user clicks on "Show More" button. In this case I recommend you to make another query and just show the results without pagination.

ModalPopupExtender From AJAX ToolKit in asp.net4.0

i have one image button on page,on click event of this imagebutton i have called one ModalPopupExtender, having definition as
(Panel3 contains one gridview and one button whereas gridview gets filled in codebehind)
But when i click the imagebutton, for 1st time it displays Panel3 with only button for 2seconds and then page gets reloaded automatically and again Panel3 displays with gridview,why this is happning i do not understand
i need to do is, as soon as i click on ImageButton the popup should be displayed with gridview and button....please help me as soon a possible

MVC3 Navigation, browser positionin g

I have a C#.NET MVC3 web app. I have a View that has a List of Models. This list can be long, requiring the user to scroll down on the View. When selecting one of the models in the View to Edit, the user is taken to the Edit View. After submitting the Edit View, the user is redirected back to the List View. However, the List View is now displaying back at the top of the list. How can I redirect the user back to the same position in the List View where they clicked the Edit button?
You would probably be better suited using a modal popup dialog to edit the data, rather than navigating to another page.
While it's possible to do what you want, it's a pain. You would have to get the scroll location via javascript, save it to a hidden field, post that to your edit page, along with record number and anything else, then re-post it back to your original page when you return, then read the post value and scroll to it via javascript.
All that is avoided if you just use a modal edit dialog, then when the dialog goes away the page is still in the same place.

Resources