This code work and it also display the same page if there is an error.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Horizon Login</title>
<script type="text/javascript" src="ext30/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext30/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();
var login = new Ext.FormPanel({
monitorValid:true,
onSubmit: Ext.emptyFn,
submit: function() {
this.getForm().getEl().dom.action = "logonOp.aw";
this.getForm().getEl().dom.submit();
},
items:[
{
hideLabel: true,
name: 'domain',
inputType: 'hidden',
value: '<default>'
}
],
});
var win = new Ext.Window({
layout:'fit',
width:300,
height: 150,
closable: false,
resizable: false,
plain: true,
items: [login]
});
win.on ("show", function () {
var f = login.getForm ().findField ('userName');
f.focus.defer(1000, f);
});
win.show();
});
function handleEnter (e, loginForm)
{
if (e.getKey () == Ext.EventObject.ENTER)
loginForm.submit ();
}
</script>
<script language="JavaScript">
function doSubmit() {displayWindow = window.open('', "_self", "scrollbars=1,menubar=0,toolbar=0,resizable=1,location=0,status=0");
document.submitForm.submit();document.submitForm.reset();}</script>
<style>
body {
margin: 0; /* this will serve just as well /
font-family: Arial, Helvetica, sans-serif; / you need some backups here */
font-size: 12px;
color: #FFFFFF;
background-color: #183670;
}
/* base */
#login-box {
width:250px;
height: 350px;
color: #ebebeb;
font: 12px Arial, Helvetica, sans-serif;
background: url(login_bg.png) no-repeat left top;
padding-top: 50px;
padding-right: 25px;
padding-bottom: 25px;
padding-left: 200px;
}
#login-box img {
border:none;
}
#login-box h1 {
padding:0;
margin:0;
color: #ebebeb;
font: bold 16px "Calibri", Arial;
}
#login-box-name {
float: left;
display:inline;
padding: 5px;
width: 60px;
}
#login-box-field {
float: left;
width:200px;
margin-top: 0;
margin-right: 0;
margin-left: 0;
display: inline;
padding: 5px;
}
.form-login {
width: 150px;
border: 1px solid #0d2c52;
background-color:#1e4f8a;
font-size: 16px;
color: #ebebeb;
}
.login-box-options {
clear:both;
padding-left:87px;
font-size: 11px;
}
.login-box-options a {
color: #ebebeb;
font-size: 11px;
}
.inp_field{
border:0;
height:30px;
line-height:30px;
text-align:left;
font-size:12px;
color:#fff;
text-shadow:#007dab 0 1px 0;
background:#0092c8;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
cursor:pointer;
padding-top: 0;
padding-right: 10px;
padding-bottom: 0;
padding-left: 10px;
}
.inp_login{
border:0;
padding:0 30px;
height:30px;
line-height:30px;
text-align:center;
font-size:12px;
color:#fff;
text-shadow:#007dab 0 1px 0;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
cursor:pointer;
background-color: #97B8D1;
-moz-box-shadow:0 0 10px #4e707c;
-webkit-box-shadow:0 0 10px #4e707c;
box-shadow:0 0 10px #4e707c;
}
/* // login form */
</style>
</head>
<body>
<div style="margin-top:100px" align="center">
<div id="login-box">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<form action="logonOp.aw?domain=HY" method="post" name="submitForm" target="_self" id="submitForm" onsubmit="return checkform()">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><h1>Login Details</h1></td>
</tr>
<tr><td>
<p><br >
Username:<br />
<input name="userName" size="24" class="inp_field"></p>
<p>Password: <br />
<input name="password" type="password" size="24" class="inp_field">
</p>
<label></label>
<p>
<input type="submit" value="Login" class="inp_login">
</p></td>
</tr>
</form>
</table>
</div></div>
</body></html>