what is the best approach to using javascript to asking input username & password in a single prompt window?(multiple input field)
views:
29answers:
2
Q:
what is the best approach to create a prompt to asking input username & password by using Javascript
A:
There is a prompt() function that you can use. You can also use something like jQuery UI to create a more fancy dialog. Make sure that it's the backend server that's checking it using AJAX though. Don't store the password in the Javascript as it will be trivial just checking the source code to circumvent it.
Daniel Egeberg
2010-06-25 08:06:43
`window.prompt()` is now unusable on the general web because IE 7 and later disables it by default. Also, `window.prompt()` only has one input field, which obviously isn't sufficient for a username and password.
Tim Down
2010-06-25 08:46:39
Right okay, I wasn't aware that IE disables it. It's not like it looks very good anyway, so I certainly wouldn't use it myself.
Daniel Egeberg
2010-06-25 08:58:51
A:
You can create dialog boxes of arbitrary complexity with jQuery UI [other JavaScript UI libraries may exist].
Skilldrick
2010-06-25 08:07:58