Click here to Skip to main content
15,442,578 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

Totally new to this.

I have got the following dropdown code working with no dramas, but I have been stuck/searching to add another column (to be hidden) to use as a reference for a table lookup with the reference (Hidden textbox) being for a filter, selected after you have chosen the correct student, for a table (I will try build) under the dropdown from which I will fill from another XML file. (The common column in both XML files will be the 'STUID' column.

The Dropdown XML is a file with DISTINCT NAMES and STUID (2 columns in total) of all students. The Table XML has STUID and other information. (8 columns in total)

If someone can point me in the right direction it would be much appreciated. As mentioned above, I am totally new to this and just finding snippets here and there for what I need to do on this small project.

Here is my current Code:
    <pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" media="all" href="style.css" />
    <script type="text/javascript" src="jquery.min.js"></script>
    <title>Using jQuery and XML to populate a drop-down box demo</title>
    type: "GET",
    url: "PDC_InstrExport2.xml",
    dataType: "xml",
    success: function(xml) {
    var select = $('#mySelect');
    //$('Name', xml).each(function(){
    var value1 = $(this).text();
    select.append("<option class='ddindent' value='"+ value1 +"'>"+value1+"</option>");
    select.children(":first").text("Select PDC Student").attr("selected",true);
    } //sucess close
    <input name="Hidden1" type="hidden" />
    <h2>Header is Here</h2>
    <img src="Monkey.jpg" alt="Logo Here" width="80" height="80"/>
    <div id="page-wrap">
    <select id="mySelect">

Sample of the Dropdown XML file is as follows:


-<tbl_pdc_instrweb_export2>ABELLANOSA, ELAINE JOY-4W


-<tbl_pdc_instrweb_export2>ALBA, RUBY SOCORRO-4W


-<tbl_pdc_instrweb_export2>AMODIA, FAY LORRAINE-2W


-<tbl_pdc_instrweb_export2>AWE, DEONA MAE-4W


What I have tried:

Inserting another line after $(this).find('Name').each(function(){ with new 'find' as such $(this).find('StuID').each(function(){

I am totally lost

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900