Is there any way to create prompt with two input fields? Is there any way to create prompt with two input fields? javascript javascript

Is there any way to create prompt with two input fields?


This is not possible with an OS or native browser window popping up. You will have to create a custom overlay dialog.

I would advise using a library like jQuery UI to do this. You can then customize whatever is in the popup.

You can view a demo of the dialog here


Short of constructing your own using DOM methods and Input elements: No.


JavaScript Code

           <script>             $( "#create-user" )             .button()             .click(function() {             $( "#dialog-form" ).dialog( "open" );               });            });           </script>

Html Code:

          <div id="dialog-form" title="Create new user">          <p class="validateTips">All form fields are required.</p>          <form>         <fieldset>         <label for="name">Name</label>          <input type="text" name="name" id="name" class="text">          <label for="email">Email</label>         <input type="text" name="email" id="email" value="" class="text">         <label for="password">Password</label>          <input type="password" name="password" id="password" value="" class="text">        </fieldset>        </form>       </div>        <button id="create-user">Create new user</button>