0

When function setUsernameAndPassword() starts I want to display popup window, where are two inputs (username and password). User fill these inputs, press OK and then continue function and sets var username and password. How can I do this?

function setUsernameAndPassword(){

//display popoup window with two inputs

var username = "";
var password = ""; 
}   

<div id="login_form">
<form class="form" action="" method="post" name="login_form" id="login_form">
<p>Username <input type="text" name="username" /></p>
<p>Password <input type="password" name="pass" /></p>
<input type="submit" name="submit" value="Login" />
</form>
</div>

I look at the jquery dialog, but this is too complicated, I want something simple and without css. And also JavaScript Prompt() method is not a good solution because I need two inputs in one popup window.

3
  • you are going to have to attempt this first before people will really help you. Also why without css? You are going to have to style an overlay with a box, then just toggle a hide/show class with javascript. Commented May 15, 2014 at 18:21
  • can be two inputs in prompt()? @mhu Commented May 15, 2014 at 21:27
  • No, just one at the time Commented May 16, 2014 at 12:45

1 Answer 1

0

You could place your username and password entry controls inside a that is normally not shown until login button is clicked and then when the user clicks accept button you simply close the .

Sign up to request clarification or add additional context in comments.

1 Comment

Ooops Forgot the code <div>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.