Hello,
I did try several options, but without any luck. The username textfield doesn't get the focus when the form is loaded.
Any suggestion is appreciated.
Kind regards,
Ricardo
Ext.onReady(function(){
var headerPanel = new Ext.Panel({
title: '',
border:false,
layout:'',
defaults: {bodyStyle:'border:0px; padding:0px;'},
items: {html: ''}
});
var loginPanel = new Ext.form.FormPanel({
baseCls: '',
frame:true,
labelAlign: 'right',
url:'xmlhttp/GetData.aspx?mode=login',
bodyStyle:'padding:20 5 5 5px;',
labelWidth: 100,
defaults: {width: 145},
defaultType: "textfield",
items: [{labelStyle:'font-size:8pt;',id:"username",fieldLabel:"Gebruikersnaam",maxLength:50},{labelStyle:'font-size:8pt;',id:"password",fieldLabel:"Wachtwoord",inputType:"password",maxLength:50}]
});
function executelogin() {
if (loginPanel.form.isValid())
{
loginPanel.form.submit(
{
params:{actie:'lgn'}, waitMsg:'Inloggen...', waitTitle:'Geduld',
failure: function(form, action) {Ext.MessageBox.alert('Geen toegang', 'U heeft geen toegang. Controleer gebruikersnaam en wachtwoord en probeer opnieuw.');},
success: function(form, action) {location.reload(true);}
});
} else {
Ext.MessageBox.alert('Foutmelding', 'Geef een gebruikersnaam en wachtwoord op en probeer opnieuw.'); TheMSsForum.com >> Asp >> How to set focus on a button ? - The :: delete command doesnt work as I want Here is want I and writting. table has a checkbox, button, textfield, and combobox.(SERVER CONTROLS) i should http://www.themssforum.com/Asp/focus-buttonHOME | Coding Horror: Please Dont Steal My Focus:: The existing focus stealing prevention setting doesnt work. web pages should never explicitly set focus because the user doesnt expect this. http://www.codinghorror.com/blog/archives/001011.htmlHOME |
}
}
var loginWindow = new Ext.Window({
title: 'Autorisatie',
width: 300,
height: 270,
iconCls:'dcmlogin',
resizable: false,
bodyStyle:'padding:0px;',
closable:false,
buttonAlign:'center',
closeAction:'hide',
items: [headerPanel, loginPanel],
buttons: [{text: 'Login', handler: function() {executelogin();}}]
});
loginWindow.show();
Ext.get('username').on('keydown', function(){if (event.keyCode==13){executelogin();};});
Ext.get('password').on('keydown', function(){if (event.keyCode==13){executelogin();};});
Ext.get('username').focus();
});
See the thread directly below yours.
http://extjs.com/forum/showthread.php?t=24866
Please search the forum in future.
Sorry i did search the newsgroup. Looks like this post was just between my search and post in.
I appreciated your reply very much. It is working with the link you suggested.
Thank you again.
Ricardo
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|