Hello,
I am trying to create an alert message box in my login page in case someone input a wrong password just like in the Cpanel
Well, this is what I did so far:
I copy the code in this demo example: demo
index.php
<!DOCTYPE HTML>
<html>
<head>
<!-- alert add -->
<link id="ui-theme" rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.0/themes/ui-lightness/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="http://pontikis.github.com/jui_alert/v2.0.0/jquery.jui_alert.css"/>
<!-- custom classes -->
<link rel="stylesheet" href="index.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://pontikis.github.com/jui_alert/v2.0.0/jquery.jui_alert.min.js"></script>
<script type="text/javascript" src="http://pontikis.github.com/jui_alert/v2.0.0/i18n/en.js"></script>
<script type="text/javascript" src="index.js"></script>
<!-- end -->
<link href= "../css/admin.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript">
$(function() {
$("#user_message1").jui_alert({
containerClass: "container1 ui-widget",
message: "<img src="images/megaphone.png" style="float: left; width: 30px; margin-right: 10px;">This is a sample message. It will disappear after 6 sec (except you press the pin button)",
timeout: 6000,
messageIconClass: ""
});
$("#user_message2").jui_alert({
containerClass: "container2 ui-widget",
message: "This is a sample message. It will not disappear automatically. More information <a href="http://www.google.com" target="_blank">here</a>.",
messageBodyClass: "message2",
timeout: 0,
use_effect: {effect_name: "slide", effect_options: {"direction": "left"}, effect_duration: "500"}
});
$("#user_message3").jui_alert({
containerClass: "container3 ui-widget",
message: "This is a <strong>sample error message</strong>. It will disappear after 3 sec (except you press the pin button)",
timeout: 3000,
messageAreaClass: "jui_alert_message_area ui-state-error ui-corner-all",
messageIconClass: "jui_alert_icon ui-icon ui-icon-alert"
});
});
</script>
<style>
.container1 {
width: 40%;
margin: 20px;
}
.container2 {
width: 50%;
margin: 20px;
}
.container3 {
width: 60%;
margin: 20px;
}
.message2 {
font-size: 13px;
font-family: Arial, sans-serif;
letter-spacing: 1px;
}
</style>
</head>
<div id="logincontainer">
<center>
<!-- alert add -->
<div id="user_message1">A</div>
<div id="user_message2">B</div>
<div id="user_message3">C</div>
<!-- end -->
<div id="loginbox">
<table>
<form action="proses.php" method="POST">
<tr>
<td>Login:</td>
<td><input size="30px" type="text" name="username" value=""/></td>
</tr>
<tr>
<td>Password:</td>
<td><input size="30px" type="password" name="password" value=""/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login"></td>
</tr>
</form>
</table>
</div>
</center>
</div>
</html>
I place all the code that I copied between the mark: <!-- alert add --> and <!-- end -->
The message is suppose to be appearing between A, B, & C letter, but in this case, nothing appears except for that plain letter.
note: I already download and extract the files to my folder eventhough I haven't address it yet, I thought using the online link suppose to work the same way.