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 7639515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:26:15+00:00 2026-05-31T08:26:15+00:00

I have an ExtJS FormPanel with different form items (textfields, numeric etc) in some

  • 0

I have an ExtJS FormPanel with different form items (textfields, numeric etc) in some cases I need an addtional file upload in this form.

(In my opinion) The best solution would be a extJs filefield in the FormPanel, which starts the upload as soon as a file is selected by the user. After uploading the file successfully (getting {success: true, fileid: 17} from the server) the filefield should disappear and a text message (“File upload was successful”) should be shown instead. Additionally to the text message a (new) hidden input with the fileid has to be added to the FormPanel:

  1. User selects file with ExtJs filefield.
  2. Upload is started immediately (onChange).
  3. Server answers with success: true and fileId
  4. Text “File upload was successful” replaces the filefield
  5. hidden form item with fileId is added to the form

Is there any way to achieve this (or a similar solution) with ExtJS 4?

  • 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-31T08:26:16+00:00Added an answer on May 31, 2026 at 8:26 am

    Easiest way is to wrap filefield in panel and replace content in handler. Example:

    var formPanel = Ext.create('Ext.form.Panel', {
        renderTo: 'testdiv',
        title: 'Basic information',
        id: 'schnitzel',
        items: [
            {
                xtype: 'textfield',
                name: 'title',
                fieldLabel: 'Title'
            },
            {
                xtype: 'panel',
                layout: 'fit',
                border: false,
                items: [{
                    xtype: 'filefield',
                    buttonOnly: true,
                    name: 'file',
                    onChange: function(value) {
                        var panel = this.ownerCt;
                        formPanel.submit({
                            url: 'index4_submit.php',
                            waitMsg: 'Uploading the image ..',
                            clientValidation: false,
                            success: Ext.Function.bind(panel.onSuccess, panel)
                        });                    
                    }
                }],
                onSuccess: function(form, action) {
                    if (action.result.success !== true) {
                        return;
                    }
    
                    this.removeAll();
                    this.add({ 
                        xtype: 'label',
                        text: 'File upload was successful'
                    });
                    this.add({ 
                        xtype: 'hidden',
                        name: 'file',
                        value: action.result.fileid
                    });
                }
            }
        ]
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have got an extjs 3.1.1 form with file upload field ( http://www.extjs.com/deploy/dev/examples/form/file-upload.html from
I have a border layout in ExtJS, The north region contains some HTML, but
I have a simple ExtJS 4 (xtype form) inside a window. It has two
Inside my extjs FormPanel , I have several editor grids. I don't know what
I'm using ExtJS 3. I have a formPanel with many cloned fields and I
In my form panel, i have some fields who are required . I explain
I have a extjs button Order with menu items 'orderInsuranceMenu' for the button. I
I have an Extjs Grid with a Paging toolbar. I need to pass the
I have an ExtJs formpanel with standardSubmit: false. On submit, the controller will validate
I have a simple ExtJs form panel which contains a fileuploadfield. When I submit

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.