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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:48:03+00:00 2026-05-14T14:48:03+00:00

I am a newb when it comes to JSON and am wanting to try

  • 0

I am a newb when it comes to JSON and am wanting to try to write a JSON select option autofiller, but do not know where to start.

The way my script works currently is using PHP and MySQL to fill the first set of select options with a distinct list from a DB table and then upon a user selection the next set of select options are autofilled with options that are linked to the first set. Is there anyway to do this in JSON?

  • 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-14T14:48:04+00:00Added an answer on May 14, 2026 at 2:48 pm

    Sure. Lets say you have some simple JSON:

    { "Options": [
        { "Text":"MyText","Value":"MyValue"},
        { "Text":"MyText2","Value":"MyValue2"}
       ]
    }
    

    Then, you evaluate that to JavaScript:

    var options = eval('(' + myJson + ')'); // myJson is your data variable
    

    Then, you simply create each option in the dom (I’ll use jQuery for brevity sake)

    var length = options.length;
    
    for(var j = 0; j < length; j++)
    {
        var newOption = $('<option/>');
        newOption.attr('text', options[j].Text);
        newOption.attr('value', options[j].Value); // fixed typo
        $('#mySelect').append(newOption);
    }
    

    Or something similar to this effect.

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

Sidebar

Related Questions

I'm a little bit of a newb when it comes to PHP, but know
Ok, I know this is probably a pretty newb question, but when it comes
I'm a relative newb when it comes to regexes, but i'm starting to get
I'm a complete newb when it comes to regex and I need a way
I'm kind of a newb when it comes to emacs. I know about the
I'm a newb when it comes to javascript. Perhaps somebody could help me with
Newb question. How can you know what the main launch Activity is? Learning Android.
I am a newb when it comes to HTML5 and the infamous Canvas element.
First of all, I must state that I'm a complete newb when it comes
Newb question of the day: I'm trying to select all the users with this

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.