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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:47:50+00:00 2026-05-31T07:47:50+00:00

I have a chrome extension in which I have two text boxes, one for

  • 0

I have a chrome extension in which I have two text boxes, one for URL and other for LDAP. Whenever user clicks on extension icon, a popup page opens and I fill the URL text box with the current page URL with the help of following code:

function setValue()
{
    var text = document.getElementById("url_textbox");
    var ldap = document.getElementById("ldap_textbox");    
    chrome.tabs.getSelected(null, function(tab) {
        text.value = tab.url;
        ldap.focus();
    });
}

The statement ldap.focus() is not working here. I am calling this function on page load.

<body onload = "setValue();">

What can I do for this?

Edit : This statement get the HTML element from the document whose Id is ldap_textbox.

var ldap = document.getElementById("ldap_textbox");
  • 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-31T07:47:51+00:00Added an answer on May 31, 2026 at 7:47 am

    I just found a solution for this. I needed to set focus on the ldap textbox which was below the URL textbox and for some reason, in the popup page default focus is going to the first element. So, I changed the first element to the ldap textbox. 🙂

    <script type="text/javascript">
    function setValue()
    {
        var text = document.getElementById("url_textbox");
        chrome.tabs.getSelected(null, function(tab) {
            text.value = tab.url;
        });
    }
    </script>
    
    <html>
        <body onload="setValue();">
            <table>
            <tr>
                <td>LDAP</td><td><input type="text" id="ldap_textbox"/></td>
            </tr>
            <tr>
                <td>URL</td><td><input type="text" id="url_textbox"/></td>
            </tr>
            </table>
         </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop a Google Chrome extension. When the user clicks the extension
I'm working on a chrome extension, which use asynchronous functions, and I have a
I have a chrome extension which monitors the browser in a special way, sending
I am creating a Chrome extension which will send the URL of every page
I have a windows application which installs a Chrome extension via the windows registry.
I have a Chrome extension which is injecting some code into a web page
I have an extension which using chrome local storage. I connect to the local
I have made a Google Chrome extension which mimics the Internet Explorer favorites drop-down.
Happy new year :) I have a Chrome extension which is a popup that
I am making a Google Chrome extension and I would like to have my

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.