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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:07:30+00:00 2026-06-13T12:07:30+00:00

I would like to allow users to press a button on my page that

  • 0

I would like to allow users to press a button on my page that will autofill a form with their first name, last name, and e-mail address, provided that they are logged into Facebook. If they are not, then the Facebook login form should popup, allowing the user to login, and then the auto fill should take place.

I have been messing around with this in the javascript test console. I know I will need to call the first_name, last_name, and email, but I’m not sure how to populate my form fields with this information.

FB.api(
      {
        method: 'fql.query',
        query: 'SELECT first_name, last_name, email FROM user WHERE uid=' + response.authResponse.userID
      },

I would like to do this in javascript. I need to create a function that will populate a form with this information on click. Any ideas?

  • 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-13T12:07:31+00:00Added an answer on June 13, 2026 at 12:07 pm

    Why don’t you use Registration Plugin. It will save you a lot of work https://developers.facebook.com/docs/plugins/registration/

    In Case you want to have custom form. You would have to take permission from user and get his details. You can use following Code :

    <div id="fb-root"></div> 
    <script src="https://connect.facebook.net/en_US/all.js"></script> 
    FB.init({appId: 'XXXXXXXXXXXXX',status : true,xfbml  : true, cookie: true ,oauth  : true});
    
    
    function login(){
            FB.getLoginStatus(function(response) {
            // checks if user already authorized
                        if (response.status === 'connected') {
                                FB.api('me?fields=id,name,email', function(user) {
                                         if(user != null) {
                                                                    username  = user.name;
                                                                    uid = user.id;
                                                                    email = user.email;
                                                                }
                                    });
    
                        } else {
            // If user is not authorized call FB.login for pop up window for authorization  , scope defines list of persmission requested with user
                        FB.login(function(response) {
                                if (response.authResponse.accessToken) {    
                                                FB.api('me?fields=id,name,email', function(user) {
                                                        if(user != null) {
                                                                    username  = user.name;
                                                                    uid = user.id;
                                                                    email = user.email;
                                                                }
                                                            }) 
                                                        } 
                                                    }, {scope:'email'});
                        }
    
                    });
        }
    

    You call login() at the press of your button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a new controller that will allow the admin user
I would like to allow the users based on his fingerprint. Is that possible
I would like to allow users to call my ruby on rails app as
I have a ASP.NET 3.5 web application and I would like to allow users
I'm using CKEditor and would like to be able to allow users to upload
I've got a html-page with a picture on it and would like allow the
I'd like to allow a user to press a button directly from my app
I would like to allow users to scroll a DataGrid horizontally even if there
I would like to allow users to choose a Font Size from a ComboBox,
I'm writing a JavaScript web application. I would like to allow users to search

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.