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

  • Home
  • SEARCH
  • 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 8926903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:05:55+00:00 2026-06-15T08:05:55+00:00

this is extjs javascript code Ext.require([ //’Ext.form.*’, //’Ext.layout.container.Column’, //’Ext.tab.Panel’ ‘*’ ]); Ext.onReady(function() { Ext.QuickTips.init();

  • 0

this is extjs javascript code

        Ext.require([
            //'Ext.form.*',
            //'Ext.layout.container.Column',
            //'Ext.tab.Panel'
            '*'
        ]);

        Ext.onReady(function() {
            Ext.QuickTips.init();

            var bd = Ext.getBody();


            bd.createChild({tag: 'h2', html: 'Form 5 - ... and forms can contain TabPanel(s)'});

            var required = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';

            var tab2 = Ext.widget({
                title: 'Inner Tabs',
                xtype: 'form',
                id: 'innerTabsForm',
                collapsible: true,
                bodyPadding: 5,
                width: 600,
                 url:'http://localhost/form/database.php',
                fieldDefaults: {
                    labelAlign: 'top',
                    msgTarget: 'side'
                },
                defaults: {
                    anchor: '100%'
                },

                items: [{
                    xtype: 'container',
                    layout:'hbox',
                    items:[{
                        xtype: 'container',
                        flex: 1,
                        border:false,
                        layout: 'anchor',
                        defaultType: 'textfield',
                        items: [{
                            fieldLabel: 'First Name',
                            afterLabelTextTpl: required,
                            allowBlank: false,
                            name: 'first',
                            anchor:'95%'
                        }, {
                            fieldLabel: 'Enquiry Date ',
                            name: 'Enquiry Date ',
                            xtype: 'datefield'
                }]
                    },{
                        xtype: 'container',
                        flex: 1,
                        layout: 'anchor',
                        defaultType: 'textfield',
                        items: [{
                            fieldLabel: 'Last Name',
                            afterLabelTextTpl: required,
                            allowBlank: false,
                            name: 'last',
                            anchor:'95%'
                        },{
                            fieldLabel: 'Email',
                            afterLabelTextTpl: required,
                            allowBlank: false,
                            name: 'email',
                            vtype:'email',
                            anchor:'95%'
                        }]
                    }]
                },{
                    xtype:'tabpanel',
                    plain:true,
                    activeTab: 0,
                    height:600,
                    defaults:{
                        bodyPadding: 10
                    },
                    items:[{
                        title:'Personal Details',
                        defaults: {
                            width: 230
                        },
                        defaultType: 'textfield',

                        items: [{
                        fieldLabel: 'Age',
                        name: 'age',
                        xtype: 'numberfield',
                        minValue: 0,
                        maxValue: 100
                        },{
                    xtype: 'fieldset',
                    flex: 1,
                    title: 'Gender',
                    defaultType: 'radio', // each item will be a radio button
                    layout: 'anchor',
                    defaults: {
                        anchor: '100%',
                        hideEmptyLabel: false
                    },
                    items: [ {
                        checked: true,
                        boxLabel: 'Male',
                        name: 'gender',
                        inputValue: 'male'
                    }, {
                        boxLabel: 'Female',
                        name: 'gender',
                        inputValue: 'female'
                    }]
                },{
                    xtype: 'fieldset',
                    flex: 1,
                    title: 'Marrital Status',
                    defaultType: 'radio', // each item will be a radio button
                    layout: 'anchor',
                    defaults: {
                        anchor: '100%',
                        hideEmptyLabel: false
                    },
                    items: [ {
                        checked: true,
                        boxLabel: 'Single',
                        name: 'mstatus',
                        inputValue: 'single'
                    }, {
                        boxLabel: 'Married',
                        name: 'mstatus',
                        inputValue: 'married'
                    }]
                },{
                            fieldLabel: 'Company',
                            name: 'company',
                            value: 'Ext JS'
                        }, {
                            fieldLabel: 'Email',
                            name: 'email',
                            vtype:'email'
                        }]
                    },{
                        title:'Phone Numbers',
                        defaults: {
                            width: 230
                        },
                        defaultType: 'textfield',

                        items: [{
                            fieldLabel: 'Home',
                            name: 'home',
                            value: '(888) 555-1212'
                        },{
                            fieldLabel: 'Business',
                            name: 'business'
                        },{
                            fieldLabel: 'Mobile',
                            name: 'mobile'
                        },{
                            fieldLabel: 'Fax',
                            name: 'fax'
                        }]
                    },{
                        cls: 'x-plain',
                        title: 'Rmarks',
                        layout: 'fit',
                        items: {
                            xtype: 'htmleditor',
                            name: 'bio2',
                            fieldLabel: 'Remarks'
                        }
                    }]
                }],

                buttons: [{
                    text: 'Save',          
                    handler: function () {
                        tab2.getForm().submit({
                         method: 'POST',
                        url: 'http://localhost/form/database.php',
                            waitMsg: 'Saving...',   
                            success: function () {     
                                Ext.MessageBox.alert ('Message','Data has been saved');
                                tab2.getForm().reset();
                            },
                          failure: function () {   
                                Ext.MessageBox.alert ('Message','Saving data failed');
                            }
                        });
                    }
                },{
                    text: 'Cancel',
                    handler: function () {
                        tab2.getForm().reset();
                    }
                }]
            });

            tab2.render(document.body);
            //tab2.render('form');
        });

php code

    <?php
    $con = mysql_connect("localhost","root","");
        if (!$con)
        {
        die('Could not connect: ' . mysql_error());
        }
        mysql_select_db("stratageeks", $con);
        $q=mysql_query ("INSERT INTO data (name,lastname) VALUES ('".isset($_POST['first'])."','".isset($_POST['last'])."')");
         if ($q) {
         echo '{"success":"true"}';
        }
        else {
          echo '{"success":"false"}';
        }

    ?>

above code is my Extjs javascript code
and below code is my database code for inserting to data in database from extjs form

but data stored in database
name:1
lastname:1

form post data is
name:ravi
lastname:kumar

  • 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-06-15T08:05:56+00:00Added an answer on June 15, 2026 at 8:05 am

    The problem is in this bit of code:

    . isset($_POST['first']) . "','" . isset($_POST['last']) .
    

    isset() returns TRUE or FALSE, which when inserted to the database translates to 1 and 0 respectively.

    You may want to consider replacing your code with this:

    $iFirst = isset( $_POST['first'] ) ? $_POST['first'] : '';
    $iLast  = isset( $_POST['last'] )  ? $_POST['last']  : '';
    
    $q = mysql_query ( "INSERT INTO data ( name, lastname ) VALUES ('". $iFirst ."','". $iLast ."')" );
    

    And if it would be my code, it would look like this (notice the consistency in field/parameters names, which also makes refactoring easier):

    $iFirstName = isset( $_POST['aFirstName'] ) ? $_POST['aFirstName'] : '';
    $iLastName  = isset( $_POST['aLastName'] )  ? $_POST['aLastName']  : '';
    
    $q = mysql_query ( "INSERT INTO data ( firstName, lastName ) VALUES ('". $iFirstName ."','". $iLastName ."')" );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My JavaScript (ExtJs 4.1.0) code is: Ext.getCmp('amount').setValue(Ext.num(Ext.getCmp('unite_price').getValue()) * Ext.num(this.getValue())); It multiplies 3 with 0.048,
I have this extjs container var cont = Ext.create('Ext.container.Container',{ cls: 'myClass1', id: myId, flex:
I've placed panel from this example http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html to Ext.window.Window and got an issue: proxy
Is it possible to build a custom version to code like this? <script type=text/javascript>
I have following code i want that window opened uses Ext.layout.BorderLayout and also on
I was trying to solve this looking at the ExtJs code, but I don't
Take a look at this example: http://www.extjs.com/deploy/dev/examples/multiselect/multiselect-demo.html On it, there are components rendered against
ExtJS 1.7.3 on FF 3.6 ² keeps stopping on this line 9863, every time
I'm using ExtJS on a registration page which should have no effect on this.
I have two dropdowns in extjs,based on the first dropdwon,the second dropdown populates.This is

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.