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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:07:29+00:00 2026-06-10T22:07:29+00:00

I am looking to do this : I have two field 1. Date –

  • 0

I am looking to do this :

I have two field
1. Date – using jquery datepicker
2. DropDown – Populated with student id

So , when i select a date say 03/09/2012 i should get all student id present on that day (say 15 of them) , then when i change the date to 04/09/2012 i should get id of only student that are present on that day ( say 29 of them)

I have done is , i have made ajax call to query the database like :

$('#date_selected').blur(function(){
$.ajax({
//query database and get the array of student id present on that date
//but from jquery how do i know populate my dropdown ?
//i would probably get the results json encoded
});
});

No issues about getting the data, i just want to know how to populate the dropdown using the array(json) that i have

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

    Use this inside your ajax success function:

    data = $.parseJSON(data);
    
    var select_fields = data.selectf;
    
    var select_id = "/*ID OF SELECT FIELD*/";
    
    $('#'+select_id+' option').remove();
    
    for(var x  in select_fields){
        $('#'+select_id).append($('<option value="'+select_fields[x]['value']+'">'+select_fields[x]['name']+'</option>'));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have two tables (I am using Django, but this question is mostly
I have been looking all over for this. I have two seperate prpt files
Let's say I have this MySQL table: OK.. see the type field? Type 0
I have this small class looking like this: private static int field1 = -
I have been looking at this for to long so I am tossing it
Looking at this article: http://www.galloway.me.uk/tutorials/singleton-classes/ I have implemented a singleton, my question is the
I have been looking over this code for the past hour, I cant see
I have string looking like this: 'Toy Story..(II) (1995)' I want to split the
I have a transition looking like this: <?xml version=1.0 encoding=UTF-8?> <transition xmlns:android=http://schemas.android.com/apk/res/android > <item
I have this input text and an input button...I am looking to have them

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.