jQuery Alert Dialogs Plug-in
prompt() functions”. The plug-in also simulates the use of these standard functions and also gives you the power to create your own style.
How to Use the Plug-in?
First, you will have to download the plug-in from this link – jQuery Alert Dialogs. Also you will have to download jQuery UI Draggable plug-in which the plug-in has dependency on it (or download the entire jQuery UI package like I did). After you download all the relevant scripts, you will have to add the plug-ins to your web application. Here is how my sample solution was ordered:
In the default page, I've added the following links in the head section:
<link href="Content/Style/jquery.alerts.css" rel="stylesheet" type="text/css" />
Now, you will be able to use the plug-in included methods:
jAlert(message, [title, callback]) – creates an alert.
jConfirm(message, [title, callback]) – creates a confirm alert which handles the confirmation in the callback function you supply.
jPrompt(message, [value, title, callback]) – creates a prompt alert which handles the value of the user type in the callback function you supply.
The following example shows how to use the alert and prompt:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Defualt.aspx.cs"
and the output of pushing the prompt button:
The jQuery Alert Dialogs plug-in is a very useful plug-in. Avoid using the built-in alerts and start using a more styled and beautiful alerts. If the supplied style isn't good for your needs, then customize it and make it more suitable.