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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:10:26+00:00 2026-05-31T22:10:26+00:00

I have the following problem. I got two forms on my web page. On

  • 0

I have the following problem. I got two forms on my web page. On the first form can I select a users whit a select box. When I have selected the users in the form, I will send it to the another form on the same web page. How can I be sure that the first page does not reload when i post the form? It is not intended that when I enter some data and a user wants to add the data that I entered are gone by reloading the page by post. I know this can be done with jquery, but I have no idea how this goes.

Thanks

  • 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-31T22:10:27+00:00Added an answer on May 31, 2026 at 10:10 pm

    You can achieve this by using jQuery.ajax() function.

    jQuery('#firstForm').live('submit',function(event) {
        $.ajax({
            url: 'GetUserInfo.php', // script to return user info in json format
            type: 'POST',
            dataType: 'json',
            data: $('#firstForm').serialize(),
            success: function( data ) {
                for(var id in data) {
                    jQuery('secondForm#' + id).val(data[id]); // loop json data to populate each field of second form
                }
            }
        });
        return false;
    });
    

    GetUserInfo.php

    • Get user’s name from $_POST variable
    • Get User information from database.
    • Create an array of user info such that index of each value should represent id of a second form field.

    For Example:

    $userInfo = array( 'FirstName' => 'abc', 'LastName' => 'xyz', 'DOB' => '01/01/2000');
    

    Here FirstName, LastName and DOB are the IDs of form elements in second form

    • echo you data into json format:

    echo json_encode( $userInfo );

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

Sidebar

Related Questions

I have the following problem: I got a view with two text fields and
I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User
i have a little big problem. My problem is the following. I´ve got two
I've got the following problem (test version available http://jsfiddle.net/qmP8R/2/ ): I have two <div>
I have got the following problem since the server has safe mode turned on,
i have got the following problem: I want to create a new Liferay Theme
I have got a problem when I try to make following simple connections QSpinBox
I'm fighting about two days with the following problem and hope you can give
I have got a bit of a problem. I have two pages (Thumbnail.aspx &
I have got a problem with two tables: CREATE TABLE IF NOT EXISTS `addresses`

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.