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

  • Home
  • SEARCH
  • 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 914717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:45:51+00:00 2026-05-15T17:45:51+00:00

Using jQuery I get JSON object that extracts one row from database. That row

  • 0

Using jQuery I get JSON object that extracts one row from database. That row has about 30 columns so along with row data, success message (success = true) JSON result returns array with table columns (ex: id, name, address, etc) called table_columns.

The purpose is to place all the returned data into the relevant html form fields (for example: address input will be filled with data.adress) and I would like to descover the trick that lets loop through data.table_columns array and stores json data into its corresponding form inputs. Let me show you a code to explain it better:

$.getJSON(base_url+'index.php/iprdb/ajax_get_row/'+entry_id, function(data){
    if(!data.success) {
        alert('server error. please try again or contact support');    
    } else {
         $.each(data.table_columns, function(i, item) {
             var myVar = item; // gets table column name ex: address
             $('#'+myVar).val(data.myVar); // stores address into input with id #address
         });                    
    }    
});

so is it possible to access data.address for example using this method?

  • 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-15T17:45:51+00:00Added an answer on May 15, 2026 at 5:45 pm

    I have figures it:

    var myVar = item;
    $('#'+myVar).val(data[myVar]);
    

    🙂

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

Sidebar

Related Questions

Javascript/JQuery noob here, so apologies. I'm using .ajax to get a JSON object then
I have a json object that I'm loading from wordpress using the JSON API
I'm using the following jQuery code to get a JSON file from CouchDB. Function
I am working on a website that will post a JSON object (using jQuery
In ASP.NET MVC, I'm using JSON and jquery to get data for a chart.
I am using jQuery to get data from server. Data is coming. Here what
I am doing an ajax call using jquery to get data in json format.
I need to convert a string to a JSON object that gets returned from
I'm trying to get a json serialized object from within an MVC user control
I'm using jQuery $.getJSON(..) to get some json. The passed value shows me undefined

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.