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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:37:55+00:00 2026-05-26T06:37:55+00:00

I have set up a key and can get the recaptcha to show on

  • 0

I have set up a key and can get the recaptcha to show on the page it self but I don’t know how to get it into a form.

Actually I don’t want to use an id since I’ll be reusing this later inside the app too so to use itemId would be preferred.I’m assuming that the element hasn’t been created yet.

My include:
HTML Code:

<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>

Error (generated from recaptcha_ajax.js. Can’t get the control with id ‘recaptcha’):
Uncaught TypeError: Cannot set property ‘innerHTML’ of null

Here’s the code:

Ext.define('Login.view.Login', {
extend: 'Ext.form.Panel',
alias: 'widget.Login.view.Login',


border: false,
bodyPadding: 5,


initComponent: function() {


    var config = {
        layout: 'anchor',
        defaultType: 'textfield',
        defaults: {
            anchor: '100%',
            allowBlank: false
        },
        items: [{
            fieldLabel: 'Company Id',
            name: 'companyId'
        },{
            fieldLabel: 'Username',
            name: 'username'
        },{
            fieldLabel: 'Password',
            name: 'password',
            inputType: 'password'
        },{
            /*xtype: 'panel',
            itemId: 'reCaptcha',
            border: false,*/
            html: '<div id="recaptcha">adsf</div>'
        }],
        buttons: [{
            text: 'Login'
        }]
    };
    Ext.apply(this, config);


    this.callParent();
},
afterRender: function() {
    Recaptcha.create("heres_my_public_key",
        document.getElementById('recaptcha'),
        {
            theme: "clean"/*,
            callback: Recaptcha.focus_response_field*/
        }
    );
    this.callParent();
}
});

Anyone done this using ExtJS 4?

/K

  • 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-26T06:37:55+00:00Added an answer on May 26, 2026 at 6:37 am

    captcha created too early. Solution:

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="ext-4.0.6/resources/css/ext-all.css" type="text/css">
        <link rel="shortcut icon" type="image/png" href="../Icon.png">
        <script type="text/javascript" src="ext-4.0.6/ext-all-debug.js"></script>
        <script type="text/javascript" src=""></script>
        <script type="text/javascript">
    
    Ext.define('Login.view.Login', {
        extend: 'Ext.form.Panel',
        alias: 'widget.Login.view.Login',
    
        border: false,
        bodyPadding: 5,
    
        initComponent: function() {
    
            var config = {
                layout: 'anchor',
                defaultType: 'textfield',
                defaults: {
                    anchor: '100%',
                    allowBlank: false
                },
                items: [{
                    fieldLabel: 'Company Id',
                    name: 'companyId'
                },{
                    fieldLabel: 'Username',
                    name: 'username'
                },{
                    fieldLabel: 'Password',
                    name: 'password',
                    inputType: 'password'
                },{
                    xtype: 'panel',
                    itemId: 'reCaptcha',
                    border: false,
                    html: '<div id="recaptcha">adsf</div>',
                    listeners:{
                         {
                            console.log(Ext.getDom(this.body));
                            Recaptcha.create("heres_my_public_key",
                                Ext.getDom(this.body),
                                {
                                    theme: "clean",
                                    callback: Recaptcha.focus_response_field
                                }
                            );
                        }
                    }
                }],
                buttons: [{
                    text: 'Login'
                }]
            };
    
    
            Ext.apply(this, config);
    
            this.callParent();
        }/*,
        afterRender: function() {
            var captchaEl = Ext.get('recaptcha');
            console.log(captchaEl);
            Recaptcha.create("heres_my_public_key",
                document.getElementById('recaptcha'),
                {
                    theme: "clean",
                    callback: Recaptcha.focus_response_field
                }
            );
            this.callParent();
        }*/
    });
    
    // entry point
    Ext.onReady(function() {
        var l = Ext.create('Login.view.Login', {renderTo:Ext.getBody()});
    }); // eo onReady
    
    </script>
    </head>
    <body>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I give set foreign key value field in Entity Framework. I have
I have a public/private key pair set up so I can ssh to a
I have next interface public interface IMyInterface { string this[string key] { get; set;
So I have a form that can get data from a database by its
I have the following code $.post( /factory/set,{ key : value }, function(response) { });
I have 2 web applications where I have to set the machine key to
I have a primary key set up to auto increment. I am doing multiple
I have a function that I set custom key and value to it and
I have a Map that uses a Set for the key type, like this:
I have set a background on the data-role=page element like so <div data-role=page style=background:

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.