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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:06:36+00:00 2026-05-21T04:06:36+00:00

I have a form that requires a physical address. Once the user enters the

  • 0

I have a form that requires a physical address. Once the user enters the full address, I have a button that says “Verify address”. I want to be able to click that button, trigger an ajax call that will call a file in the server which will get the longitude and latitude of that address, then return to the form with those coordinates, and display a div with them. Dont worry about figuring out the coordinates. Im just trying to figure out the whole ajax call and jquery display upon response from the server. Thanks

So, I did this to have things working:

$(document).ready(function() {

//if verify button is clicked
$('#verify').click(function () {

    var address = $('input[name=address]');
    var city    = $('input[name=city]');
    var state   = $('input[name=state]');
    var zip     = $('input[name=zip]');
    var country = $('select[name=country]');

    //organize the data for the call
    var data = 'address=' + address.val() + '&city=' + city.val() + '&state=' + state.val() + '&zip='  + zip.val() + '&country='  + country.val();

    //start the ajax
    $.ajax({
        url: "process.php",
        type: "GET",
        data: data,
        cache: false,
        success: function (html) {

            //alert (html);

            if (html!='error') {

                //show the pin long and lat form
                $('.form2').fadeIn('slow');

            } else alert('Error: Your location cannot be found');
        }
    });

    //cancel the submit button default behaviours
    return false;
});
});

process.php returns the longitude and latitude back in a variable as: “longitude,latitude”. How do I access that data back in the front end so I can populate the form fields with it? Thanks a lot for the great responses.

  • 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-21T04:06:37+00:00Added an answer on May 21, 2026 at 4:06 am

    I hope this is helpful. This would be a generic AJAX call to a php page:

    $.ajax({
                type: "POST",
                url: "scripts/process.php",
                data: "type=query&parameter=" + parameter,
                success: function (data) {  //Called when the information returns
                    if(data == "success"){
                      //Success
                    } else {
                      //Fail
                    }
                },
                error: function () {
                      //Complete failure
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form here that requires the user to enter a value. <form
I have a form that requires the user to enter some information. If they
I have a disclosure form that requires a user to enter yes/no answers for
I have a form on a page that requires a captcha if the user
In my current application I have a form that requires the user to enter
I currently have form that checks if a user has unsubmitted changes when they
I have a form that I want to be validated before showing it initially.
I have a form that the user submits and returns a result, but it
I have a form that i want to appear at the top of every
I have a form that i want an administrator to fill out, then click

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.