开发者

How can I make a popup form?

开发者 https://www.devze.com 2023-04-11 16:54 出处:网络
I want to password protect my page which I am doing using LDAP bind authentication. That whole process and script is fine. Now I have this form which submits to that script and that script checks whet

I want to password protect my page which I am doing using LDAP bind authentication. That whole process and script is fine. Now I have this form which submits to that script and that script checks whether the user has authentication or not, if they don't it kicks them out.

What I am trying to do here is this. http://jsfiddle.net/s5JyR/ that form I have there, I would like to make that a popup login instead so as soon as 开发者_高级运维a user goes to the url of the site they get a blank page with a POPUP screen asking for the login. How can I do make that popup? if the user clicks cancel it should display Error. Access denied. Or if the user inputs the wrong login credentials display that same error message. The error messages don't need to be a popup, they can be displayed on a different blank page. All the forms I have looked around Google have a popup from a button which isn't what I want..

I am trying to make something like this:

How can I make a popup form?


In Javascript you can do that by opening a new Window with the window.open() method, opening an URL with the form and then capturing its information from outside. But that might fail in platforms not supporting it.

Another method can be showing the form in a floating box, but it is still Javascript dependant.

Maybe what you actually want is an HTTP login form, it is not Javascript but it does exactly what you ask for. Though you will have to handle everything server-side.

Take a look at HTTP Authentication with PHP to learn about this.
...Assuming that you have PHP for server side scripting, if not, it is still a good reference that you can not-so-differently implement in other languages.

0

精彩评论

暂无评论...
验证码 换一张
取 消