PDA

View Full Version : help me in login



Laufwerk
30 Jun 2008, 1:32 AM
Helloooo!!! I try to build my personal login
http://www.demo.humaniza.com/exemples/errores/login-extjs.jpg
and i have some questions
1.- When I open my web page, the button submit displays out of margin, as you see in the image.
2.- In combo Language, I need that by default show me my default language "Spanish"
and
3.- when the user click on combo language i want that the page change the language that user select

This is the code
login.js
[code]// JavaScript Document
Ext.onReady(function(){
Ext.QuickTips.init();
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.
var login = new Ext.FormPanel({
labelWidth:120,
url:'procesalogin.php',
frame:true,
title:'<center>LOGIN</center>',
width:230,
padding:200,
defaultType:'textfield',
monitorValid:true,

// Specific attributes for the text fields for username / password.
// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:'Username',
name:'loginUsername',
allowBlank:false
},{
fieldLabel:'Password',
name:'loginPassword',
inputType:'password',
allowBlank:false
},{
xtype:'iconcombo',
fieldLabel:'Language',
name:'loginIdioma',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', 'Angl

Laufwerk
30 Jun 2008, 4:20 AM
The language selection i need from this example
http://extjs.com/learn/Tutorial:Localizing_Ext (http://extjs.com/forum/../learn/Tutorial:Localizing_Ext)

Thanks!

Laufwerk
2 Jul 2008, 6:25 AM
upup:((

Laufwerk
9 Jul 2008, 4:46 AM
help
!!

Starfall
9 Jul 2008, 5:09 AM
1. This is the sizing issue. Adjust heights of your window or form
2. Set value property of ComboBox
3. This question is like "Build an app for me, please"

Laufwerk
9 Jul 2008, 5:23 AM
1. This is the sizing issue. Adjust heights of your window or form WORK IT CORRECT
2. Set value property of ComboBox HOW?
3. This question is like "Build an app for me, please" ECUAL EXAMPLE LOCALIZATION, BUT DON'T WORK

:((

Laufwerk
9 Jul 2008, 5:27 AM
2.-Set value property of ComboBox HOW?
if i write value:'es',
the firebug shows me


this.icon is undefined
setIconCls()()Ext.ux.I...nCombo.js (l

carol.extjs
9 Jul 2008, 6:33 AM
1. layout issues... what browser are you using? what version of extjs? Are you using a doctype in your html?

I tried IE7, FF 2.0.0.15, Opera 9.51 and it doesn't look like yours (the button is not off the display and login title bar looks normal). You example isn't a drop in and I don't have the icon images.

2. The iconcombo class doesn't handle the setting of 'value'[1], you could search forum for answers to that problem or perhaps try setting the value in a render listener in your iconcombo config.



listeners: {
'render': function() {
this.setValue('es');
}
}

[1] What I mean by that is that the iconcombo setValue() function calls setIconCls() function that tries to set this.icon before it is rendered ... this.icon is created in the onRender() function.

RobSmith
9 Jul 2008, 6:55 AM
1. I guess, this is because of your padding=200 statement. Try to remove it and look what happens.

Laufwerk
9 Jul 2008, 7:02 AM
I remove this line, but don't happens anything!!!!

can u show me with images?

Laufwerk
9 Jul 2008, 7:10 AM
1. layout issues... what browser are you using? what version of extjs? Are you using a doctype in your html?
I USE IE7, FF 3 and SAFARI 3.1
I tried IE7, FF 2.0.0.15, Opera 9.51 and it doesn't look like yours (the button is not off the display and login title bar looks normal). You example isn't a drop in and I don't have the icon images.

2. The iconcombo class doesn't handle the setting of 'value'[1], you could search forum for answers to that problem or perhaps try setting the value in a render listener in your iconcombo config.
THE PEOPLE IN THIS FORUM DON'T PARTICIPATES VERY MUCH, AND I SEARCH MUCH, BUT I HAVEN'T FOUND ANYTHING


listeners: {
'render': function() {
this.setValue('es');
}
}[1] What I mean by that is that the iconcombo setValue() function calls setIconCls() function that tries to set this.icon before it is rendered ... this.icon is created in the onRender() function.

NOW ALREADY IT WORKS, BUT I NEED THAT QHEN THE USER CLIC ON COMBOBOX LANGUAGE, CHANGE ALL CODE LANGUAGE AND PRESERVE THE VALUES; FOR EXAMPLE:
IF AN USER WRITE YOUR USER NAME, AFTER YOUR PASSWORD, AND AFTER WILL SELECT ANOTHER LANGUAGE I WANT THAT ON RELOAD PAGE PRESERVE YOUR USERNAME, USERPASS, AND NEW LANGUAGE SELECTED

carol.extjs
9 Jul 2008, 7:22 AM
Please don't shout at us (all uppercase == shouting). You've got to be kidding when you say people don't participate much!

3. I haven't looked at the localization stuff, I'll leave that to someone else.


I INSERT YOUR CODE BUT FIREBUG SHOWS ME:
missing } after property list
'render' : function() {this.setValue('es'); }\n

Where did you put that code? Here's a bigger snippet:

[CODE]
{
xtype:'iconcombo',
fieldLabel:'Language',
name:'loginIdioma',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', 'Angl

Laufwerk
9 Jul 2008, 7:25 AM
OKOK NOW ALREADY IT WORKS.

BIG THANKS!!
NOW I NEED...THAT WHEN THE USER CLICK ON COMBOBOX LANGUAGE, CHANGE ALL CODE LANGUAGE AND PRESERVE THE VALUES; FOR EXAMPLE:
IF AN USER WRITE YOUR USER NAME, AFTER YOUR PASSWORD, AND AFTER WILL SELECT ANOTHER LANGUAGE I WANT THAT ON RELOAD PAGE PRESERVE YOUR USERNAME, USERPASS, AND NEW LANGUAGE SELECTED

Laufwerk
9 Jul 2008, 8:05 AM
well !!
now it only comes off for me that it changes of language. I have this code



// JavaScript Document
// decode language passed in url
var locale = window.location.search
? Ext.urlDecode(window.location.search.substring(1)).locale
: 'es'
;

// append locale script to the head
var head = Ext.fly(document.getElementsByTagName('head')[0]);
if(locale) {
Ext.fly('extlocale').set({src:'../../library/extjs/source/locale/ext-lang-' + locale + '.js'});
}

Ext.onReady(function(){
Ext.QuickTips.init();
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.

var login = new Ext.FormPanel({
labelWidth:120,
url:'procesalogin.php',
frame:true,
title:'<center><img src="img/logo_humaniza.png" style="margin-top:7px;"></img><br />Intranet ver. 2.0&szlig;</center>',
width:230,
defaultType:'textfield',
monitorValid:true,
// Specific attributes for the text fields for username / password.
txtUserName:'Username',
txtPassword:'Password',
txtselectLang:'Select Language',
txtRemindMe:'Remind Me Later!!',
txtSubmit:'Login',
txtUKLang:'English',
txtESLang:'Spanish',
txtCATLang:'Catalan',

// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:this.txtUserName,
name:'loginUsername',
allowBlank:false
},{
fieldLabel:this.txtPassword,
name:'loginPassword',
inputType:'password',
allowBlank:false,
listeners:{
blur : function(){ this.setRawValue(hex_md5(this.getValue())); }
},
},{
xtype:'iconcombo',
fieldLabel:this.txtselectLang,
name:'loginIdioma',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', this.txtUKLang, 'ux-flag-us'],
['es', this.txtESLang, 'ux-flag-es'],
['ca', this.txtCATLang, 'ux-flag-catalonia']
]
}),

listeners :{
'render' : function() {this.setValue('es'); },
select:{fn:function(combo){
window.location.search = '?' + Ext.urlEncode({locale:combo.getValue()});
}}

},
valueField: 'countryCode',
displayField: 'countryName',
iconClsField: 'countryFlag',
triggerAction: 'all',
mode: 'local',
allowBlank:false,
width:129,
editable: false,
},{
xtype:'checkbox',
fieldLabel:this.txtRemindMe,
name:'loginRemidMe',
// allowBlank:true
}],

// All the magic happens after the user clicks the button
buttons:[{
text:this.txtSubmit,
formBind: true,
// Function that fires when user clicks the button
handler:function(){
login.getForm().submit({
method:'POST',
// waitTitle:'Connecting',
// waitMsg:'Sending data...',

// Functions that fire (success or failure) when the server responds.
// The one that executes is determined by the
// response that comes from login.asp as seen below. The server would
// actually respond with valid JSON,
// something like: response.write "{ success: true}" or
// response.write "{ success: false, errors: { reason: 'Login failed. Try again.' }}"
// depending on the logic contained within your server script.
// If a success occurs, the user is notified with an alert messagebox,
// and when they click "OK", they are redirected to whatever page
// you define as redirect.

success:function(){
// Ext.Msg.alert('Status', 'Login Successful!', function(btn, text){
// if (btn == 'ok'){
var redirect = 'index.php';
window.location = redirect;
// }
// });
},

// Failure function, see comment above re: success and failure.
// You can see here, if login fails, it throws a messagebox
// at the user telling him / her as much.

failure:function(form, action){
if(action.failureType == 'server'){
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert(obj.errors.title, obj.errors.reason);
}else{
Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText);
}
login.getForm().reset();
}
});
}
}]
});

// This just creates a window to wrap the login form.
// The login object is passed to the items collection.
var win = new Ext.Window({
layout:'fit',
width:300,
height:240,
closable: false,
resizable: false,
draggable: false,
plain: true,
items: [login]
});
win.show();
});

if(locale) {
Ext.fly('applocale').set({src:'app-lang-' + locale + '.js'});
}


but my fire bug shows me

Ext.fly("extlocale") is null
login.js()()login.js (l

carol.extjs
9 Jul 2008, 8:32 AM
I don't see 'extlocale' in any of the code you posted, where is it supposed to find that from?

Laufwerk
10 Jul 2008, 4:41 AM
I don't understand.
I have this code, but i don't know if this code is correct.... i need...HAT WHEN THE USER CLICK ON COMBOBOX LANGUAGE, CHANGE ALL CODE LANGUAGE AND PRESERVE THE VALUES; FOR EXAMPLE:
IF AN USER WRITE YOUR USER NAME, AFTER YOUR PASSWORD, AND AFTER WILL SELECT ANOTHER LANGUAGE I WANT THAT ON RELOAD PAGE PRESERVE YOUR USERNAME, USERPASS, AND NEW LANGUAGE SELECTED

carol.extjs
10 Jul 2008, 5:13 AM
QUIT YELLING! IF YOU KEEP POSTING IN ALL CAPS I WILL STOP RESPONDING! It is really hard to read and is considered rude.

OK, back to the questions...


I don't understand.

In your previous post you said you get error in firebug from line 11 in login.js,


Ext.fly('extlocale').set({src:'../../library/extjs/source/locale/ext-lang-' + locale + '.js'});

The error says that Ext.fly('extlocale') is null. So, I ask where is the element 'extlocale' defined as I do not see it in the code you have posted. Is it in your html?

Laufwerk
10 Jul 2008, 5:21 AM
I'm sorry, I did not remember that the capital letters it was call. I hear it a lot, I was not my intention. And I ask for apologies since my vocabulary in English not him very extensive. Sorry

Thanks to remember it. You are very kind

Laufwerk
10 Jul 2008, 5:35 AM
i have defined extlocale in my login.php, nextly i write my code
login.php


<?php
session_start();
require_once "conf.inc.php";
if ($_GET['accion']=="logout"){
unset ($_SESSION['auth']);
unset ($_SESSION['usuario']);
setcookie(_COOKIE_PREFIX.'_cook_auth');
setcookie(_COOKIE_PREFIX.'_cook_user');
// session_destroy();
session_unset();
$_SESSION['auth']="";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/1999/xhtml">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>HUMANIZA - Intranet</title>
<!-- Bring in the ExtJs Libraries and CSS -->
<link href="../../library/extjs/resources/css/ext-all.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../library/extjs/adapter/ext/ext-base.js"> </script>
<script type="text/javascript" src="../../library/extjs/ext-all-debug.js"> </script>
<!-- Place the page specific js here -->
<script type="text/javascript" src="js/login.js"> </script>
<!-- MD5 crypt -->
<script type="text/javascript" src="js/md5.js"> </script>
<!-- Icon combo -->
<script type="text/javascript" src="js/Ext.ux.IconCombo.js"> </script>
<link href="css/login.css" type="text/css" rel="stylesheet" />
<!-- End page specific js -->

<!-- Application localization javascript -->
<script type="text/javascript" id="applocale"></script>

<!-- Ext localization javascript -->
<script type="text/javascript" id="extlocale"></script>

<script>
// decode language passed in url
var locale = window.location.search
? Ext.urlDecode(window.location.search.substring(1)).locale
: ''
;

// append locale script to the head
var head = Ext.fly(document.getElementsByTagName('head')[0]);
if(locale) {
Ext.fly('extlocale').set({src:'../../library/extjs/source/locale/ext-lang-' + locale + '.js'});
}
</script>
</head>
<body>
</body>
</html>

and this is my login.js

// JavaScript Document
// decode language passed in url
var locale = window.location.search
? Ext.urlDecode(window.location.search.substring(1)).locale
: 'es'
;

// append locale script to the head
var head = Ext.fly(document.getElementsByTagName('head')[0]);
if(locale) {
Ext.fly('extlocale').set({src:'../../library/extjs/source/locale/ext-lang-' + locale + '.js'});
}

Ext.onReady(function(){
Ext.QuickTips.init();
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.

var login = new Ext.FormPanel({
labelWidth:120,
url:'procesalogin.php',
frame:true,
title:'<center><img src="img/logo_humaniza.png" style="margin-top:7px;"></img><br />Intranet ver. 2.0&szlig;</center>',
width:230,
defaultType:'textfield',
monitorValid:true,
// Specific attributes for the text fields for username / password.
txtUserName:'Username',
txtPassword:'Password',
txtselectLang:'Select Language',
txtRemindMe:'Remind Me Later!!',
txtSubmit:'Login',
txtUKLang:'English',
txtESLang:'Spanish',
txtCATLang:'Catalan',

// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:this.txtUserName,
name:'loginUsername',
allowBlank:false
},{
fieldLabel:this.txtPassword,
name:'loginPassword',
inputType:'password',
allowBlank:false,
listeners:{
blur : function(){ this.setRawValue(hex_md5(this.getValue())); }
},
},{
xtype:'iconcombo',
fieldLabel:this.txtselectLang,
name:'loginIdioma',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', this.txtUKLang, 'ux-flag-us'],
['es', this.txtESLang, 'ux-flag-es'],
['ca', this.txtCATLang, 'ux-flag-catalonia']
]
}),

listeners :{
'render' : function() {this.setValue('es'); },
select:{fn:function(combo){
window.location.search = '?' + Ext.urlEncode({locale:combo.getValue()});
}}

},
valueField: 'countryCode',
displayField: 'countryName',
iconClsField: 'countryFlag',
triggerAction: 'all',
mode: 'local',
allowBlank:false,
width:129,
editable: false,
},{
xtype:'checkbox',
fieldLabel:this.txtRemindMe,
name:'loginRemidMe',
// allowBlank:true
}],

// All the magic happens after the user clicks the button
buttons:[{
text:this.txtSubmit,
formBind: true,
// Function that fires when user clicks the button
handler:function(){
login.getForm().submit({
method:'POST',
// waitTitle:'Connecting',
// waitMsg:'Sending data...',

// Functions that fire (success or failure) when the server responds.
// The one that executes is determined by the
// response that comes from login.asp as seen below. The server would
// actually respond with valid JSON,
// something like: response.write "{ success: true}" or
// response.write "{ success: false, errors: { reason: 'Login failed. Try again.' }}"
// depending on the logic contained within your server script.
// If a success occurs, the user is notified with an alert messagebox,
// and when they click "OK", they are redirected to whatever page
// you define as redirect.

success:function(){
// Ext.Msg.alert('Status', 'Login Successful!', function(btn, text){
// if (btn == 'ok'){
var redirect = 'index.php';
window.location = redirect;
// }
// });
},

// Failure function, see comment above re: success and failure.
// You can see here, if login fails, it throws a messagebox
// at the user telling him / her as much.

failure:function(form, action){
if(action.failureType == 'server'){
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert(obj.errors.title, obj.errors.reason);
}else{
Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText);
}
login.getForm().reset();
}
});
}
}]
});

// This just creates a window to wrap the login form.
// The login object is passed to the items collection.
var win = new Ext.Window({
layout:'fit',
width:300,
height:240,
closable: false,
resizable: false,
draggable: false,
plain: true,
items: [login]
});
win.show();
});

if(locale) {
Ext.fly('applocale').set({src:'app-lang-' + locale + '.js'});
}



but I repeat to him, this code I have removed from the localitzation example, I believe that he will very still have to adapt himself

carol.extjs
10 Jul 2008, 6:21 AM
but I repeat to him, this code I have removed from the localitzation example, I believe that he will very still have to adapt himself

Sorry, but I don't understand this sentence. Not sure who or what you are talking about. Is the error trying to do Ext.fly('extlocale') still an issue? I finally see what you were trying to do there.

Laufwerk
10 Jul 2008, 6:39 AM
yes, I will explain myself more, sorry.
Exists an example tutorial called "Localizing_Ext", and this is the link http://extjs.com/learn/Tutorial:Localizing_Ext (http://extjs.com/forum/../learn/Tutorial:Localizing_Ext).

I exctract this code from this example, and i have tried to implement on my login.js.

My code initial of login.js is :

// JavaScript Document
Ext.onReady(function(){
Ext.QuickTips.init();
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.

var login = new Ext.FormPanel({
labelWidth:120,
url:'procesalogin.php',
frame:true,
title:'<center><img src="img/logo.png" style="margin-top:7px;"></img><br />LOGIN</center>',
width:230,
defaultType:'textfield',
monitorValid:true,
// Specific attributes for the text fields for username / password.
txtUserName:'Username',
txtPassword:'Password',
txtselectLang:'Select Language',
txtRemindMe:'Remind Me Later!!',
txtSubmit:'Login',
txtUKLang:'English',
txtESLang:'Spanish',
txtCATLang:'Catalan',

// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:this.txtUserName,
name:'loginUsername',
allowBlank:false
},{
fieldLabel:this.txtPassword,
name:'loginPassword',
inputType:'password',
allowBlank:false,
listeners:{
blur : function(){ this.setRawValue(hex_md5(this.getValue())); }
},
},{
xtype:'iconcombo',
fieldLabel:this.txtselectLang,
name:'loginIdioma',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', this.txtUKLang, 'ux-flag-us'],
['es', this.txtESLang, 'ux-flag-es'],
['ca', this.txtCATLang, 'ux-flag-catalonia']
]
}),

listeners :{
'render' : function() {this.setValue('es'); },
select:{fn:function(combo){
window.location.search = '?' + Ext.urlEncode({locale:combo.getValue()});
}}

},
valueField: 'countryCode',
displayField: 'countryName',
iconClsField: 'countryFlag',
triggerAction: 'all',
mode: 'local',
allowBlank:false,
width:129,
editable: false,
},{
xtype:'checkbox',
fieldLabel:this.txtRemindMe,
name:'loginRemidMe',
// allowBlank:true
}],

// All the magic happens after the user clicks the button
buttons:[{
text:this.txtSubmit,
formBind: true,
// Function that fires when user clicks the button
handler:function(){
login.getForm().submit({
method:'POST',
// waitTitle:'Connecting',
// waitMsg:'Sending data...',

// Functions that fire (success or failure) when the server responds.
// The one that executes is determined by the
// response that comes from login.asp as seen below. The server would
// actually respond with valid JSON,
// something like: response.write "{ success: true}" or
// response.write "{ success: false, errors: { reason: 'Login failed. Try again.' }}"
// depending on the logic contained within your server script.
// If a success occurs, the user is notified with an alert messagebox,
// and when they click "OK", they are redirected to whatever page
// you define as redirect.

success:function(){
// Ext.Msg.alert('Status', 'Login Successful!', function(btn, text){
// if (btn == 'ok'){
var redirect = 'index.php';
window.location = redirect;
// }
// });
},

// Failure function, see comment above re: success and failure.
// You can see here, if login fails, it throws a messagebox
// at the user telling him / her as much.

failure:function(form, action){
if(action.failureType == 'server'){
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert(obj.errors.title, obj.errors.reason);
}else{
Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText);
}
login.getForm().reset();
}
});
}
}]
});

// This just creates a window to wrap the login form.
// The login object is passed to the items collection.
var win = new Ext.Window({
layout:'fit',
width:300,
height:240,
closable: false,
resizable: false,
draggable: false,
plain: true,
items: [login]
});
win.show();
});without:
txtUserName:'Username',
txtPassword:'Password',
txtselectLang:'Select Language',
txtRemindMe:'Remind Me Later!!',
txtSubmit:'Login',
txtUKLang:'English',
txtESLang:'Spanish',
txtCATLang:'Catalan',

and replacing this.txtXXXXX for its original text.

U understand me?

I expect to have explained myself well

carol.extjs
10 Jul 2008, 11:47 AM
Sorry, but no I do not understand. I do not know what code + html you are using together and what error you are currently getting. If you provide a drop in example we could try running it.

The last error you posted was Ext.fly at line 11 in login.js, but now that line is not in login.js.

I also did not understand what you were trying to say here:


without:
txtUserName:'Username',
txtPassword:'Password',
txtselectLang:'Select Language',
txtRemindMe:'Remind Me Later!!',
txtSubmit:'Login',
txtUKLang:'English',
txtESLang:'Spanish',
txtCATLang:'Catalan',

and replacing this.txtXXXXX for its original text.

Did the original localization example work for you? If you are still having issues I would recommend editing the title of the original post to something about your localization issue.

Laufwerk
10 Jul 2008, 11:54 PM
Did the original localization example work for you? Yes

Let's see, we start from the beginning and we make step by step.
Now, i will put the code of html (php) and js that until now it worked correctly.
login.php

<?php
session_start();
require_once "conf.inc.php";
if ($_GET['accion']=="logout"){
unset ($_SESSION['auth']);
unset ($_SESSION['usuario']);
setcookie(_COOKIE_PREFIX.'_cook_auth');
setcookie(_COOKIE_PREFIX.'_cook_user');
// session_destroy();
session_unset();
$_SESSION['auth']="";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/1999/xhtml">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>xxxxxxx</title>
<!-- Bring in the ExtJs Libraries and CSS -->
<link href="../../library/extjs/resources/css/ext-all.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../library/extjs/adapter/ext/ext-base.js"> </script>
<script type="text/javascript" src="../../library/extjs/ext-all-debug.js"> </script>
<!-- Place the page specific js here -->
<script type="text/javascript" src="js/login.js"> </script>
<!-- MD5 crypt -->
<script type="text/javascript" src="js/md5.js"> </script>
<!-- Icon combo -->
<script type="text/javascript" src="js/Ext.ux.IconCombo.js"> </script>
<link href="css/login.css" type="text/css" rel="stylesheet" />
<!-- End page specific js -->

<!-- Application localization javascript -->
<script type="text/javascript" id="applocale"></script>

<!-- Ext localization javascript -->
<script type="text/javascript" id="extlocale"></script>

<script>
// decode language passed in url
var locale = window.location.search
? Ext.urlDecode(window.location.search.substring(1)).locale
: ''
;

// append locale script to the head
var head = Ext.fly(document.getElementsByTagName('head')[0]);
if(locale) {
Ext.fly('extlocale').set({src:'../../library/extjs/source/locale/ext-lang-' + locale + '.js'});
}
</script>
</head>
<body>
</body>
</html>and now the code of login.js
[code]// JavaScript Document
Ext.onReady(function(){
Ext.QuickTips.init();
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.

var login = new Ext.FormPanel({
labelWidth:120,
url:'procesalogin.php',
frame:true,
title:'<center>LOGIN</center>',
width:230,
defaultType:'textfield',
monitorValid:true,
// Specific attributes for the text fields for username / password.
// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:'Username',
name:'loginUsername',
allowBlank:false
},{
fieldLabel:'Password',
name:'loginPassword',
inputType:'password',
allowBlank:false,
listeners:{
blur : function(){ this.setRawValue(hex_md5(this.getValue())); }
},
},{
xtype:'iconcombo',
fieldLabel:'Select Language',
name:'loginIdioma',
store: new Ext.data.SimpleStore({
id:0,
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['uk', 'English', 'ux-flag-us'],
['es', 'Spanish', 'ux-flag-es'],
['ca', 'Catalan', 'ux-flag-catalonia']
]
}),
listeners :{
'render' : function() {this.setValue('es'); }, // Se sustituir