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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:02:59+00:00 2026-06-08T09:02:59+00:00

I thought I was heading in the right direction here. But somewhere, information overload

  • 0

I thought I was heading in the right direction here. But somewhere, information overload set in.

Simple task: I want to have a user select something from a drop down, and have jquery populate the form cells from that selection. The selection is sending an ID request to my ASP script, which is returning the data in a JSON format. But Jquery isn’t populating the form at all.

Here is my Jquery.

<script>
$(document).ready( function() {
    $("#list-avail-reps").change( function() {
        var rep_id = $(this).val();
        var datastring = "ID="+rep_id;
    $.ajax({
        type: "GET",
        data: datastring,
        dataType: "json",
        url: "sales-reps.asp",
        success: function(data) {
            var rep_name=json.rep_name
            var rep_cell=json.rep_cell
            var rep_email=json.rep_email
            var rep_branch=json.rep_branch
            var branch_id=json.branch_id
            $("#rep_name").val(rep_name);
            $("#rep_cell").val(rep_cell);
            $("#rep_branch").val(rep_name);
            $("#rep_email").val(rep_email);
            $("#rep_active").val('1');
            $("#rep_login_ID").val(rep_id);
            $("#branch_ID").val(branch_ID);
        }
    });//end ajax command
    }); //end of listener
});//end document function
</script>  

My JSON output is the following:

[
{
"rep_name":"Name here",
"rep_cell":"Number here",
"rep_branch":"More info",
"rep_email":"email here",
"branch_id":"5"
}
]

Any help on this would be greatly appreciated.

  • 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-08T09:03:01+00:00Added an answer on June 8, 2026 at 9:03 am

    You should use data instead of json.

    Example:

    data.rep_email versus json.rep_email

    The data that is returned appears to be an array. So you will need to iterate over your array (or assume an index of 0).

    Example:

    var rep_email = data[0].rep_email
    

    or

    for (var i = 0; i < data.length; i++) {
        var rep_email = data[i].rep_email;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought this would be fairly simple but it turns out not to work
I thought I'd find more about this topic but I didn't. I have to
I thought I had resolved this but I obviously haven't and was hoping someone
I thought the following script will create div element but I got nothing output
I thought I was pretty well acquainted with Subversion, but now something I thought
I have an interesting content layout proposal but I'm having difficulty figuring out how
I have an HTML 4.01/CSS 2.1 document that includes an H3 heading followed by
I would like to have a go at making some simple games for personal/learning
I've seen some posts on here regarding similar ideas to this, but to be
I'm really new to OpenGL but have quite a good grasp of basic trigonometry

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.