Show a modal popup in salesforce cloudpages - bootstrap-modal

I have a amscript in salesforce cloudpages that redirects to a Thank you page after user clicks on submit, how can I show up a modal instead of redirecting to a thank you page?
The modal code is in body, and i'm using bootstrap.
below is the current code that redirects to thank you page

Related

Django ERR_CACHE_MISS on login page after clicking a link and back

I have a login page with a form with username and password fields and a submit button. In the same page there are links to other pages on the site.
I'm using the vanilla Django login view. The user can login using the correct credentials, otherwise the login form shows authentication error as expected. Everything works fine so far. The issue I'm having is reproducible this way:
go to login page and input wrong credentials, submit
correctly validation errors appear on the form
click some link on the page
correctly the browser brings me on the other page following the GET request
click on browser go back button
Or, another way:
go to login page and input wrong credentials, submit
correctly validation errors appear on the form
click on browser go back button
click on browser go forward button
At this point I get this message from the browser:
Confirm Form Resubmission
This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.
Press the reload button to resubmit the data needed to load the page.
ERR_CACHE_MISS
It's weird, but even more weird is that if I check on Disable cache in Chrome DevTools Network panel, the problem disappears (ie. when I click back, I see the form precompiled with previously inserted data). So I tried to add the never_cache decorator to LoginView just to see, but then realized this view (obviously) already has the decorator applied.
I wonder what the problem is and how to solve it.

Django sign-up form scroll default

Hi in Django I have created a sign-up page, but the problem is if the page is loaded the page automatically scrolls to the e-mail field of the form instead of the top of the page.
How can I stop this?

Is it possible to create popup and exit redirect on aws S3 static website?

I just want to know if its possible to create those signup forms that popups when visitor visits the site?
And could visitors be redirected to another site once they click back or "x" button?
If you can see an html page you can include the javascript code to do that.
The javascript asociated with button click event shoul call window.location.href = "http://yourothersite.com";

jQuery SimpleModal view once using a cookie

I am new to javascript and jQuery. I am using SimpleModal basic to display a message onload when a user visits my site. It's working great, but it repeats each time I visit the page I installed the script. I need this message to be viewed once for the session.
I have searched all over the internet, and have seen that this can be taken care of using a cookie, but I'm not sure of how to tie the cookie function into the function of the modal script.
How can I implement a cookie to track the modal function, and display it only once when the page loads?
Here is the script that loads the modal content:
jQuery(function ($) {
// Load dialog on page load
$('#basic-modal-content').modal();
});
Thanks for your help!

django login popup

I've been trying to figure out how to do a modal login in django and have been having some trouble. Is this possible? It seems like it should be. I imagine the solution involves writing a view that takes a POST request and returns some JSON.
Are there any examples out there of how to do this in a clean way?
The easiest way I've found is to do the following:
Write a simple standalone login view
Display this view on your pages as an iframe using a javascript modal dialog (I recommend Colorbox).
Because you're displaying an iframe, you don't have to worry about ajax sends etc. The iframe can just post data and redirect normally.
On a successful login, redirect the iframe to a 'success' page. After a few seconds, have that page send a message to the parent window, which can then close the modal box and make any necessary changes to itself.