Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


onSelect JS

Posted on 2005-04-25
Medium Priority
Last Modified: 2008-01-09

Its easy but seems to be difficult for me. Initial dropdown of 'Product' and 'Version' should be deactive. Now I have Form Field 'Family' which has dropdown list, onSelect  cooresponding family, a 'Product' list should display in 2nd dropdown list and onSelect correspoiding Product, 'version' list should display in 3rd dropdown.

------My Form-----
Family :: <dropdown list>
Product :: <dropdown list>
Version ::  <dropdown list>

Using a Stored Procedure I can able to display list of Family, when user select any one from list of dropdown in Family I'll be passing that variable name to 2nd stored procedure and will be getting list of product and similary the version. Now when I select a family it will be passed to some JS, how should pass that JS variable to a JSP  ?

Sample code would be great !!

Thanks for your time.

Question by:princehyderabad
LVL 25

Expert Comment

ID: 13861317
check all the links there, and also answers of ldbkutty!

And here in this link: some more ideas to make it work with back end


Author Comment

ID: 13861846
LInks are good no doubt.

Q1. Instead of Servlet we can using JSP too rite ?

Q2. But my idea was instead of calling or send to servlet and servlet redirecting/depatching back and forth. Dont we have any better way to keep it in single page wihout moving back and forth.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 25

Accepted Solution

archrajan earned 252 total points
ID: 13862009
You have to research it with


Author Comment

ID: 13862125
any Sample Code or link.

Currently I'm doing JSP -> JSP - JSP. Sometime it is getting a bit delay. Will your iframes or XMLHTTP make it faster or it may be of same speed

Assisted Solution

haobaba1 earned 248 total points
ID: 13862872
do a google on xmlHttpRequest it is supported by most browsers and isn't that difficult to understand or implement.

//This function returns a new httprequest object
function getNewHttpRequest(req)
    if (window.XMLHttpRequest)
        req = new XMLHttpRequest();

    else if (window.ActiveXObject)
        req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
      return req;

function processResponse(req)
      // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            var xmlDom=req.responseXML;
                  var mesg= xmlDom.getElementsByTagName('mesg')[0];
                  if(mesg != null)
                        var txt=mesg.getAttribute('text');
                        setMessage('message','mtext','The Servers Response could not be read (format unknown)');
        } else {
            alert("There was a problem retrieving the XML data:\n" +

function SendQuickInquiry()
      var com= document.getElementById('comment');
      var txt= com.value;
      if(txt != null && txt != '')
            var req = getNewHttpRequest(req);
            var url=baseURL.concat('inquiry/QuickInquiry?comment=').concat(txt);
            var func= function(){ processResponse(req);}
            setMessage('message','mtext','You must enter a comment');

      return false;
LVL 10

Expert Comment

by:Andrew Beers
ID: 14592829
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

http:Q_21401698.html --> Split haobaba1(Accept this as solution) and archrajan

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

572 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