Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:03:47+00:00 2026-05-25T18:03:47+00:00

I have a form panel and i want text fields stick to their labels

  • 0

I have a form panel and i want text fields stick to their labels but labelAlign:’right’ isn’t working and text fields are aligned centrally

here is my code:

Ext.ns('Tunkv.forms');
Tunkv.forms.user_settings = Ext.extend(Ext.form.FormPanel, {
// i inserted labelAlign here,maybe the wrong place???
labelAlign : 'right',
labelWidth : 80,
layout:'form'
 ,border:false
,frame:true
,url:'index.php?option=com_Tunkv&c=doctor&task=saveProfile&format=raw'

,constructor:function(config) {
    config = config || {};
    config.listeners = config.listeners || {};
    Ext.applyIf(config.listeners, {
        actioncomplete:function() {
            if(console && console.log) {
                console.log('actioncomplete:', arguments);
            }
        }
        ,actionfailed:function() {
            if(console && console.log) {
                console.log('actionfailed:', arguments);
            }
        }
    });
    Tunkv.forms.user_settings .superclass.constructor.call(this, config);
}

,initComponent:function() {
    var timezones = new Ext.data.SimpleStore({
    fields: ['id', 'timezone'],
    data : [<?php
    echo $this->zonesdata;
    ?>]
});
var joomlaEditors = new Ext.data.SimpleStore({
    fields: ['id', 'editor'],
    data : [<?php
    echo $this->editors;
    ?>]
});
var languages = new Ext.data.SimpleStore({
    fields: ['id', 'language'],
    data : [<?php
    echo $this->languages;
    ?>]
});
var ext_templates = new Ext.data.SimpleStore({
    fields: ['id', 'ext_template'],
    data : [<?php
    echo $this->ext_template;
    ?>]
});
    // hard coded - cannot be changed from outside
  var config = {
  items: [{

        xtype: 'textfield',
        fieldLabel: 'Name',
        name: 'name',
        allowBlank: false,
        value: '<?php
        echo $user->name;
        ?>',
        maxLength: 32,
        maxLengthText: 'Maximum name length is 36 characters.',
        msgTarget:'side'
    },{
        xtype: 'textfield',
        fieldLabel: 'Username',
        name: 'username',
        minLength: 2, maxLength: 32,
        minLengthText:'Username must be at least 2 characters long. ',
        maxLengthText: 'Maximum username length is 36 characters.',
        value: '<?php
        echo $user->username;
        ?>',
        allowBlank : false,
        msgTarget:'under'
    },{
        xtype: 'textfield',
        inputType: 'password',
        fieldLabel: 'Password',
        name: 'password',
        minLength: 6, 
        maxLength: 32,
        minLengthText: 'Password must be at least 6 characters long.',
        maxLengthText: 'Maximum Password length is 36 characters.',
        msgTarget:'under'

    },{
        xtype: 'textfield',
        fieldLabel: 'Email',
        name: 'email',
        vtype: 'email',
        allowBlank : false,
        value: '<?php
        echo $user->email;
        ?>',
        msgTarget:'under'
    },{
        xtype: 'combo',
        name: 'joomlaeditor',
        fieldLabel: 'Editor',
        mode: 'local',
        store: joomlaEditors,
        displayField:'editor',
        value: '<?php
        echo $user->getParam ( 'editor' );
        ?>',
        msgTarget:'under'
    },{
        xtype: 'combo',
        name: 'language',
        fieldLabel: 'Language',
        mode: 'local',
        store: languages,
        displayField:'language',
        value: '<?php
        echo $user->getParam ( 'language' );
        ?>',
        msgTarget:'under'
    },{
        xtype: 'combo',
        name: 'timezone',
        fieldLabel: 'Timezone',
        mode: 'local',
        store: timezones,
        displayField:'timezone',
        value: '<?php
        echo $user->getParam ( 'timezone' );
        ?>'
        ,
        msgTarget:'under'
    },{
        xtype: 'combo',
        name: 'ext_template',
        fieldLabel: 'Skin',
        mode: 'local',
        store: ext_templates,
        displayField:'ext_template',
        value: '<?php
        echo $user->getParam ( 'ext_template' );
        ?>'
        ,msgTarget:'under'
    },{
        xtype: 'hidden',
        fieldLabel: '<?php
        echo JUtility::getToken ();
        ?>',
        name: '<?php
        echo JUtility::getToken ();
        ?>',
        value: '<?php
        echo JUtility::getToken ();
        ?>',
        hideLabel:true
    }] 
        ,buttons:[{
             text:'Submit'
            ,formBind:true
            ,scope:this
            ,handler:this.submit
        }]
    }; // eo config object

    // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));

    // call parent
    Tunkv.forms.user_settings .superclass.initComponent.apply(this, arguments);

} // eo function initComponent

/**
 * Form onRender override
 */
,onRender:function() {

    // call parent
    Tunkv.forms.user_settings .superclass.onRender.apply(this, arguments);

    // set wait message target
    this.getForm().waitMsgTarget = this.getEl();

} // eo function onRender


/**
 * Submits the form. Called after Submit buttons is clicked
 * @private
 */
,submit:function() {
    this.getForm().submit({
         url:this.url
        ,scope:this
        ,success:this.onSuccess
        ,failure:this.onFailure
        //,params:{cmd:'save'}
        ,waitMsg:'Saving...'
    });
} // eo function submit

/**
 * Success handler
 * @param {Ext.form.BasicForm} form
 * @param {Ext.form.Action} action
 * @private
 */
,onSuccess:function(form, action) {
    Ext.Msg.show({
         title:'Success'
        ,msg:'Form submitted successfully'
        ,modal:true
        ,icon:Ext.Msg.INFO
        ,buttons:Ext.Msg.OK
    });
} // eo function onSuccess

/**
 * Failure handler
 * @param {Ext.form.BasicForm} form
 * @param {Ext.form.Action} action
 * @private
 */
,onFailure:function(form, action) {
    this.showError(action.result.error || action.response.responseText);
} // eo function onFailure

/**
 * Shows Message Box with error
 * @param {String} msg Message to show
 * @param {String} title Optional. Title for message box (defaults to Error)
 * @private
 */
,showError:function(msg, title) {
    title = title || 'Error';
    Ext.Msg.show({
         title:title
        ,msg:msg
        ,modal:true
        ,icon:Ext.Msg.ERROR
        ,buttons:Ext.Msg.OK
    });
} // eo function showError

   }); // eo extend

   // register xtype
   Ext.reg('settingsform', Tunkv.forms.user_settings ); 

// invalid markers to sides
 Ext.form.Field.prototype.msgTarget = 'side';

// create and show window
var userSettingsWindow = new Ext.Window({
    title: 'Settings panel'
    ,layout:'fit'
    ,width:800
    ,height:520
    ,closable:true
    ,items:{id:'formloadsubmit-form', xtype:'settingsform'}
});

  // eof
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:03:48+00:00Added an answer on May 25, 2026 at 6:03 pm
    labelAlign : 'right'
    

    Controls the position and alignment of the fieldLabel and should be inserted into fieldset config object and not inside forms config object.

    For example:

    {
        xtype: 'combo',
        name: 'ext_template',
        fieldLabel: 'Skin',
        mode: 'local',
        store: ext_templates,
        displayField:'ext_template',
        value: 'value',
        msgTarget:'under',
        labelAlign : 'right'
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form field and i want to read the text entered into
i have database table with few text fields which i use to filter data
I'm stuck with populating Ext.form.Panel with data in my MVC project. In Controller I
I have a sceanrio where i want to change the styling of a div
I have a custom form that has 4 panels on it edges. I would
I have a login dropdown much like Twitter. You can check it out here
In Wicket, I'd like to subclass TextField form component to add additional markup around
In my web application I have used EXT JS code. Currently I am moving
I have a simple GWT application that consists of a FormPanel that contains a
I'm having a problem where I would like to remove a FormPanel from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.