|
| |
User Groups : Forums : SiteExperts :
Microsoft .NET
:  | 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 |
Earlier Replies | Replies 11 to 17 of 17 | Later Replies Goto Page: 3 2 1 |  | Terry Young on May 23, 2009 at 7:25:55 PM (# 11) This message has been edited.cache?
Did you have something like URL += "&ms=" + new Date().getTime() at the end of your URL querystring when you are sending the ajax request? Monte on May 24, 2009 at 5:07:03 AM (# 12)Nope. I'm getting everything from a web service I created. BachusII on May 24, 2009 at 12:15:51 PM (# 13)<lurk stop="temporary"> "source" (as supplied by server) versus "generated source"? (as supplied by server PLUS any changes introduced client side, e.g. JS using a json object to populate a select element?) Monte on May 24, 2009 at 8:22:36 PM (# 14)B2:
I'll have to get back to you on that. I'll check on Tuesday (hopefully) when I get back to work and let you know. MHenke on May 25, 2009 at 2:45:25 AM (# 15)Well, it's not that someone already mentioned the difference betweeen "view source" and "view generated source". :) busybeaver on Jun 4, 2009 at 1:02:10 PM (# 16)Well I'm myself am a computer repair person here in my town area of Nickerson, kansas, But I sort of forgot some of technology of skills since both parents have passed away in 2001 year its been about 9 years ago since I've went back practricing working on computers again. So, I need an refresher course to refresh my memory in my brind. how to set my monitor adapter to it's orgininal monitor adapter again? The computer works, I just can't see the picture at on the monitor nomore. Cause I acciedently click the monity adapter card by mistake and acciedently put in the memory adapter by mistake. Can any help me on this please? It seriously indefinitely really be appreciated very, much indeed. I tell you one thing if you don't practice on computers for a very long time especially when they was a death in your family that is. you can certain forget some of you techniques of how to work on computers, and in some ways you got to sort of train yourself all over again as an refresher course. Thank for your help of anyone giving me an advice on this please. Monte on Jun 5, 2009 at 6:21:09 AM (# 17)Way to interrupt a thread, busybeaver. Good job.
| Earlier Replies | Replies 11 to 17 of 17 | Later 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.
|