How I can I replicate JavaScript's prompt function in a new modal with a password field? -


I am rewriting a module for an internal employee application. This app currently uses JavaScript prompt windows for some functions and prompt window is requesting unique PIN code for each employee. Then this code is logged in the system through that fixed action.

Unfortunately, any person looking at the screen with JavaScript prompts can see the text written like this. I am trying to recreate this prompt function, but to do a password filter I have created a model and used an input tag with the input set with the password.

The only problem with me is that the model code is non-blocking and checks are now ignored. The first prompt was blocking the function and the code will wait for the answer.

How do I create a Javascript prompt function and its blocking in a model?

I would highly recommend using this jQuery-UI for this type of problem. It is very easy to use and you will be able to get your desired results very quickly. Here's a simple demo:

More code:

  & lt; Body & gt; & Lt; Div id = "dialog" title = "enter a value" & gt; & Lt; Input type = "password" id = "test" /> & Lt; / Div & gt; & Lt; A href = "#" & gt; I can not click until the value is entered in the dialog box & lt; / A & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("# dialog") dialog ({autoOpen: true, modal: true, closeOnEscape: false, button: {OK: function () {if ($ ("# test "") .val ()! = "") {Warning ($ ("# test"). Val ()); $ (this) .dialog ("deleted"). Remove ();}}}}}} ); & Lt; / script & gt; & gt; style & gt; .ui-dialog-titbar-close {visibility: hidden;} & lt; / style & gt; & lt; / body & gt;  

Comments