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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:50:56+00:00 2026-05-20T20:50:56+00:00

We are building an advanced form with following fields… <input type=text size=50 name=name >

  • 0

We are building an advanced form with following fields…

<input type="text" size="50" name="name" >
<input type="text" size="50" name="custid" >
<input type="text" size="50" name="projectname" >
<input type="text" size="50" name="overdue" >

We are using jquery autocomplete to select name from MySQL and what we would like to do is:

We want to add custid, projectname, and overdue to their fields after adding name automatically, we can do it in PHP but how can we do it using jQuery or ajax? Can you help us to write up the code? We can add 1 output using ajax but how do we add multiple outputs? 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-20T20:50:57+00:00Added an answer on May 20, 2026 at 8:50 pm

    You could retrieve the remaining fields using AJAX, by having a PHP script which outputs their details in JSON format. So if your data is stored in an associative array called $data, you can simply do echo json_encode( $data );. Each field name in the array, will be the name of the instance variable you’ll need to call in the jQuery. The code below assumes your array field names are the same as your inputs.

    You then use jQuery.get( ) (or similarly jQuery.ajax( )) to obtain the result. jQuery below:

    $.get('myscript.php', 
          {name: name},
          function(data) {
            // If successful, fill out the fields
            $('#custid').val(data.custid);
            $('#projectname').val(data.projectname);
            $('#overdue').val(data.overdue);
          },
          // tells jQuery it's retrieving a JSON encoded object
          'json'
    );
    

    This will also require you to slightly alter your HTML as below:

    <input type="text" size="50" name="custid" id="custid" >
    <input type="text" size="50" name="projectname" id="projectname" >
    <input type="text" size="50" name="overdue" id="overdue" >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an advanced search form for my ASP.NET MVC app. I have a
Im building a small form using ComboBoxes with lots of items, and it seems
I've recently begun working on a project regarding GUI building using some form of
I am using an html sign up form for a website I'm building. The
We got strange error last days. ___doPostBack is undefined. We are building quite advanced
I'm building an application in ruby using the sinatra framework and am having trouble
I am building my portfolio website simply using HTML , Flash , and the
I'm not sure if I'm just form building impaired or not thinking about this
I wonder if anyone could help with this. I am dynamically building a form
I am building an HTML form with a set of checkboxes for selecting multiple

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.