Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to give multiple input box in prompt alert in javascript? [closed]

i have a situation where i am bound to give multiple input box in a prompt box in JavaScript or jQuery, is there any way we can do this.

Any help would be appreciated.

like image 404
Ravinder Singh Avatar asked Oct 16 '12 06:10

Ravinder Singh


Video Answer


2 Answers

Have a look at jQuery UI Dialog, especially the modal form example.

$(document).ready(function() {
    $("#dialog").dialog({
        close: function(event, ui) { 
            // do whatever you need on close
        }
    });
});
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<div id="dialog">
  <input type="text" id="input1" />
  <input type="text" id="input2" />
</div>
like image 103
Michal Klouda Avatar answered Sep 29 '22 23:09

Michal Klouda


you cannot tweak "Prompt box" of browser, however you can use jquery ui dialog box

$( "#dialog" ).dialog();
like image 41
Chandra Sekhar Walajapet Avatar answered Sep 29 '22 22:09

Chandra Sekhar Walajapet