tags:

views:

29

answers:

2

what is the best approach to using javascript to asking input username & password in a single prompt window?(multiple input field)

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
`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
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
A: 

You can create dialog boxes of arbitrary complexity with jQuery UI [other JavaScript UI libraries may exist].

Skilldrick