Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Chained Select Menus + Load AJAX content

Posted on 2010-09-06
Medium Priority
Last Modified: 2012-06-21
Hi Experts,

I am using a script from Dynamic Drive (View script here) to have chained select menus.

In the example I have attached, I have set this up with 2 chained menus and it all works fine, I can easily make the final select menu take the user to a new page however I am trying to make the final selection load in a HTML page inside a div within the same page as opposed to leaving this page.

I am a very weak coder and hoping one of you great experts may be able to assist with this in some way.

Any help at all would be greatly appreciated.
Question by:mobius1980
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33615356
In the 'goListGroup' method of chainedmenu.js, you need to make the ajax call rather than using window.location or window.open.

for making ajax call see

Author Comment

ID: 33616084
I'm sorry, you lost me... When I said I am a weak coder, I mean very weak coder.  :-)

I presume you mean between line 26 and 30?

else if (newwindow==1)

Open in new window

LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33616298
Yes, instead of these, you have to make an ajax call to these locations.

Author Comment

ID: 33623018
Ok, I'm still no closer to a result here... I apologise for being a pain, I'm not asking you to write the code for me but I am simply lost. Everything I have tried just either loads a new page or does nothing.

Anybody else able to provide a little assistance for a complete n00b like myself?  :-)
LVL 40

Accepted Solution

Gurvinder Pal Singh earned 2000 total points
ID: 33629254
this is how you make a simple ajax request
Use the following code

function makeAJAXCall(url)
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    //this is where the ajax response will be loaded. you can change it to do something else with the ajax response

Open in new window


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question