Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Any one know how to get the form to stay in the 'popup' dialog when there is a validation error (or similar)?
for example, a login popup.
- If the username/password is wrong, then stay in the dialog (so user may try again)
Comments
Comment #1
nextpulse CreditAttribution: nextpulse commentedBTW:
I know that popups-form will keep the box open.
But I want to close it on success.
Comment #2
starbow CreditAttribution: starbow commentedInteresting use case. I will have to think about it.
Comment #3
starbow CreditAttribution: starbow commentedOk, this has been added to RC5.
* new option: reloadWhenDone - better way to cold reload the page, b/c form will stay in popup
on validation errors
* new class: popups-form-reload - adds popup behavior to link, with option reloadWhenDone = TRUE.
Comment #4
nextpulse CreditAttribution: nextpulse commentedSome issues I am seeing:
- it works in the test page (popups/test). So I know its all installed and cache it ok.
- when running in my own theme, the popup just stays open on success. Any ideas on how I can debug this?
So this is the url I have in my theme. On success the popup just stays open. It behaves just like a popups-form.
Login
Comment #5
starbow CreditAttribution: starbow commentedSurprising.
You are probably getting some kind of html error message back from Drupal. The way to debug is to get the Firebug extension to FireFox, open up the console tag, and look at the response that is coming back from the server on success. Another clue is to look at the Request Headers, and make sure "X-Drupal-Render-Mode" is set to "json/popups".
Comment #6
nextpulse CreditAttribution: nextpulse commentedI am running firebug - its not html error.
From the debug - on the GET:
X-Drupal-Render-Mode json/popups
(Hence I get the pop up).
Now - what should it be on the post? As the post returns back to the same popup.
Comment #7
nextpulse CreditAttribution: nextpulse commentedDid more testing, seems to be a issue(bug?) somewhere:
So, if the url is:
http://www.mydomain.com/popups/test
Then it works.
But If I go via a different path:
http://www.mydomain.com/user
then this fails.
(So far, the login only works if the url is /popups/test. Not on any other pages. The only diif I see is that body has the class page-popups)
Comment #8
starbow CreditAttribution: starbow commentedTricky. Why don't you open this as a new issue, and we'll see if anyone else is having the same problem.