I'm using with satisfaction the library jAlert v4 available here
But I noticed that is not possible to use this library such as a simple "prompt" (that is a simple alert with a textbox) as shown in the following code:
var qnt = prompt("Insert")
Also this library is excellent because it automatically recognize all "alert()" functions in my code and applies his styles without any further implementation (it needs only to add its libraries inside <head>
tag).
I discovered that there is also the "jQuery Alert Dialogs" library for my purpose, but it isn't customizable as jAlert v4.
So I would like to know if is possible to use the same library (jAlert v4) for my purpose, because I like the jalert customization (for ex. themes and animations) and it is very easy to use. And I want to keep the same style like my jAlert as picture below: jAlert example but with a input TextBox.
That library is overriding the browser's built-in alert()
function. You can do the same with prompt()
, and have it open a jAlert with a text box on it.
window.prompt = function(title, value){
$.jAlert({
# Add an input field
'content': '<form><label>'+title+'</label><input value="'+(value||'')+'"></form>'
# Add the buttons or whatever else you need to the jAlert
});
};