I am looking for code to do a popup.
...not just any code, Elegant code!
Here is what I'd like:
From a page open to an un-registered user
this user clicks on a link to a registered user
area, A popup box appears with the name/email/cookie
etc. request. (the /register/ page).
If errors, the message is shown in the same popup window
so that it can be corrected...(ex: 'First name required')
If successful, the popup goes away and the original full
screen browser is redirected to the registered user content.
One annoying thing about popup windows is that they
can get hidden if the main brower is clicked. It's there
but hidden and inexperienced useres don't know to click
on the task bar...
popups.... Will they work with 99.9% of browsers currently
We're just wrapping up a project (built on ACS4) that has a lot of important functionality in popups, including the sort of thing you describe here - you have no idea how much you don't want to go down that path... Unless your client (you?) is absolutely set on it, I'd suggest not trying to retrofit that sort of interface onto ACS.
If you're set on it, I can offer some suggestions to do what you're after, but it won't be elegant by any stretch of the imagination.
Now Russell asks, "do you Really REALLY *REALLY* want to do this?"
It's really a client request, so no, not REALLY!
Do you recommend using only ONE window for a website, and avoid the use of multiple browser windows like...er 'adult' sites that seem to open a gazillion browser windows? It seems like there are advantages, sometimes, to opening a new window which is just a short side path and when the user closes it, the user is back to the main page...
although I can see the attractiveness of placing short
self-contained interactions in a popup window.
You can avoid the "clicked in the main window and now I've lost
the popup" situation by using IE's window.showModalDialog() to
open a window that will hold focus untill it is closed, if you're
willing to tie yourself to IE... I presume the same behaviour can
be obtained with window.setZOptions() or onBlur="focus()" type
There are 3 solutions I can see to your particular requirement,
none of which are particularly apealing to me.
Given that opening a new window for the login sequence can be
triggered by a) clicking on a link with an appropriate onClick
handler or target attribute, or b) an onLoad handler in a page -
a) can be achieved by ensuring every link presented to the user
has been modified to do the right thing (open login popup) if the
user doesn't have correct privileges to view the target page. The
general way to do this would be to give the request processor or
templating system knowledge of what pages are potentially
restricted and have it/them rewrite links on the fly in served
pages, but it'd probably be easier to manually go through every
page that might potentially link to restricted content and add
permission-checking logic there (I wouldn't want to maintain
somethink like that). The problem with both of these aproaches
is you're requiring someone else (individual pages or
RP/templating) to know the authorization status of every page in
the site instead of allowing individual pages to make up their
own minds when actually loaded.
b) allows you to keep privilege information in a page it affects
instead of pages that link to it, but you've lost the interaction
advantage of popping up a window saying "you need to login to
do that [OK] [Cancel]" and allowing a user to not follow the link.
Your interaction is then exactly the same as the standard ACS
process, and the popup gains you nothing in useability, so why
There are other things that annoy me even more: pop up a box with 'it worked!', and just an okay button. Or even more aggravating: 'it didn't work, press reload to try again', and then, again, just an okay button - the user has to find the reload button himself...
Another problem with pop-ups is slow connections. A lot of times the main-screen has been fully loaded, images and all, before a single line in the popup shows. To make matters worse, the 'designer' has 'helped' to remove 'confusion' for the user by, erhm, changing *everything* s/he is familiar with on a browser window:
- Navigation bar (back, fwd, home): gone
- Location bar (http://....): gone
- Status bar: GONE!
- Menubar: gone
Only a 'modal' dialog for login (like basic-authentication does), would be fine for me. But remember: most sites use forms, people are used to them.
to pop-ups on the CHI-WEB list last fall:
of users, who may be conditioned to ignore or close popups
without reading them.