User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 332,654 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,330 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 403 | Replies: 2
Reply
Join Date: Mar 2008
Posts: 2
Reputation: smithsf22 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
smithsf22 smithsf22 is offline Offline
Newbie Poster

Help with Ajax toolkit drop downs

  #1  
Mar 6th, 2008
Hello,

I am new to this and have run into a small problem. I am using the Ajax toolkit with VS 2005 to fill some drop downs through a web service and it works great. All of the cascading drop downs work correctly. The only problem I have is I need to copy the drop downs value from each cascading drop down into a hidden drop down. I have struggled with this for a few days now so if anyone could offer me some advice I would really appreciate it.

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: Help with Ajax toolkit drop downs

  #2  
Mar 7th, 2008
hi
with each ajax request when you are filling your dropdown you also create hidden value node using dom apis.
use api
-document.creatElement('tag_name');
to create tag
-document.getElementById('idofparent');
to get parent element where hidden will reside
-parent.appendChild(child_node);
to add child hidden node to parent.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Mar 2008
Posts: 2
Reputation: smithsf22 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
smithsf22 smithsf22 is offline Offline
Newbie Poster

Re: Help with Ajax toolkit drop downs

  #3  
Mar 7th, 2008
Thanks for the reply but if you have the chance I could use some clarification about what you mean. I will also explain better what it is I am trying to do.

The ajax cascading drop downs work great. But I a, using a third party plug in that generates the html for the page. The original drop downs generated by the third party are not ajaxed so in the code behind I hide them all and replace them with new ajax drop downs. This works so far.

Now the problem I have is the third party checks to see if the original drop downs have been selected before you can save. and if not send an alert box saying you didnt fill them out. So what i need to do is when you select anything from the new ajax drop downs I need to set the now hidden original drop downs to the same value.

What I am trying to do, and i have no idea if it will work is register some javascript that does the work. But when I try and add the attribute of onClick to the ajax drop down it never shows up in the html:

  MyDropDownList .Category = "First";
            MyDropDownList .ServiceMethod = "FirstDropDownList";
            MyDropDownList .ServicePath = "CascadeDropDown.asmx";
            MyDropDownList .PromptText = "Please Work...";

       this.MyDropDownList .Attributes.Add("onchange", "doSomething();");
the registered javascript function doSomething does show up in the generated html.

Thanks again
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 3:08 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC