SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Microsoft .NET :

Previous DiscussionNext Discussion
 JSON question -- can any SE regulars help??
Ok, here's the scenario. I have a web app that I'm using AJAX and a web service in.

The AJAX is used to create the ModalPopup.

So I have a JavaScript called ModalPopupFunctions.js that contains a function like this:

function PopulateDropDowns(json)
{
var p, t, s, si;
var ddl = document.getElementById('myDDL');
var opt = document.createElement('OPTION');

eval("p = " + json);

// Priorities Drop-Down List.
removeOptions(ddl,p.DataList.length); // Remove any options that may be present.

// Use the addOption function to populate the correct DropDownList.
for(var i = 0; i < p.DataList.length; i++)
{
addOption(ddl, p.DataList[i].Desc, p.DataList[i].ID);
}
}

function addOption(selectbox,text,value)
{
var opt = document.createElement("OPTION");

selectbox.options.add(new Option(text));
opt.text = text;
opt.value = value;
selectbox.options.add(opt);
}

// Removing options from the appropriate drop down list.
function removeOptions(selectbox, numberOfItems)
{
for(var i = numberOfItems - 1; i >= 0; i--)
{
selectbox.remove(i);
}
}


Now, I can use this to populate a DropDownList (select), but when I view source, it's empty, so I can't get the selected value to pass back to the server. In other words, the DropDownList gets populated, but in some weird way, where if I do a view source all I see is the select open and close markup, with no options in between.

What do I need to do to accomplish this?

Started By Monte on Feb 26, 2009 at 7:09:08 AM

17 Response(s) | Reply

View All Replies | Goto Page: 3 2 1
MHenke on May 25, 2009 at 2:45:25 AM

Well, it's not that someone already mentioned the difference betweeen "view source" and "view generated source". :)


View All Replies | Goto Page: 3 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.