How to Go Back on Cancel in Laravel - laravel

Sorry if it is a very basic question. But I would like to know how can I go back to the previous page if I click on the Cancel button in a form page.
The form page has a Submit and Cancel
On Submit, it goes to the route.php and gets the Route::post('', ''); section. What about the Cancel button with a name=cancel?

To go back on a button.
<button type="button" onclick="window.location='{{ URL::previous() }}'">Cancel</button>

Laravel 4
Cancel

Related

Slack modal is not cleared from a Updated view

I have modal flow in my Slack App. I have some issues with the end of the flow however.
Basic idea of the flow. You get a Modal, you do a selection, you get another modal, you perform an action and then Modal disappears.
I have tried two different ways both with problems but with different result
Flow 1: response_action: "update"
You press a button on home tab that opens a modal with bot.views.open
You make a selection
In the response I send {response_action: 'update', view: }
User gets the new Modal without any errors. They then click a button.
Now I would like the modal to disappear. So on the result of the action I send {response_action: 'clear'}
Nothing happens :(. I would like the modal to disappear of course :)
Flow 2: bot.views.update
You press a button on home tab that opens a modal with bot.views.open
You make a selection
I create the same view as above but I run bot.views.update{view_id: , view: }
New view comes up however it has an error in the top: We had some trouble connecting. Try again?
Now I would like the modal to disappear. So on the result of the action I send {response_action: 'clear'}
Nothing happens :(. I would like the modal to disappear of course :)
So second flow has annoying error but same result with not disappearing.
Feels like Im missing something here.
Somebody have an Idea what Im missing?

How to confirm a request by clicking a button

I'm creating a laravel app whereby if user send a request you have to confirm by clicking a button. Which is the best method to implement that. Can somebody help me please.
If its a form request you can just add to the Button-Element a
onclick="return confirm('Are you sure?')" like so:
<button onclick="return confirm('Are you sure?')"> Send Request </button>
a Popup Window will ask you for confirmation
The best way to do this would be using JavaScript. You can easily achieve this with JQuery.
Have a look at this, I think this is what you need: form confirm before submit

Modal dialog - refresh the parent page on close modal dialog or submit button

Using Apex 5.1.3
I have everyting working, but I have a requreimet to refresh the entire page (parent page) on the close of the modal page or press submit button.
I have tried quite a few things in dynamic actions on the parent page etc, but nothing is working.
How can I get the parent page to fully refresh when the modal dialog is submitted and closed.
Your help would be most appreciated.
Regards,
Morshed
You could either place a branch after processing on your modal that redirects to the parent page, or create a dynamic action 'on dialog close' on the button/region that invokes the dialog page, which then submits/refreshes the page.
If you think 'nothing is working', put APEX in debug mode, open your browser console, and check if the dynamic actions are actually firing.

auto load registration form popup on checkout

i am working on oncepagecheckout, there is a link "Click here to login or create a new account", However we click on this link a popup of login form does display. but i want to display this login popup form should display automatically on page load, Kindly help
You can easily do that with jQuery. Just use below code, this will trigger a click onload of page. Just check the id of the button and replace that in the below code:
<script>
$(document).ready(function(){
$('#your_button_id').click();
});
</script>

set session on the click of edit button in grocery crud

Is there any way to set session on the click of edit button, before or on the page load in grocery crud.
$crud->callback_before_update(array($this,'encrypt_password_callback'));
we are having this for call a method but it only works when i click update button,
my requirement is to call a method when the edit page loads.
Use javascript to simulate button click, here is simple example
<input type="checkbox" onClick="document.getElementById('theSubmitButton').click();">Check the box to simulate a button click
<br>
<input type="button" name="theSubmitButton" id="theSubmitButton" value="Button" onClick="alert('The button was clicked.');">
Or you can use jQuery
jQuery('#mydiv').click();
To make it work on links, I think you need to add an onclick handler and then redirect the page.

Resources