Link should have been...
http://www.webreference.co
..also links to part 1 and 2 from that page :)
Main Topics
Browse All TopicsWhen i click combobox that particular value stored with database using Ajax with Jsp and DB2
Could you Give me the correct way for that
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Link should have been...
http://www.webreference.co
..also links to part 1 and 2 from that page :)
I don't know the JSP language, so can only offer an example. The Javascript would be basically like this...
<html>
<head>
<title>Combobox Ajax</title>
<script type="text/javascript">
<!--
function XHR(url, params, open){
this.url = url;
this.open = open || "GET";
this.params = params || "";
this.request = null;
}
XHR.prototype.ready = function(){
return (this.request.readyState == 4 && this.request.status == 200)? true : false;
}
XHR.prototype.make_request
this.request = (window.XMLHttpRequest)? new XMLHttpRequest() : new ActiveXObject("Microsoft.X
if(this.request){
this.request.onreadystatec
this.request.open(this.ope
if(this.open.toLowerCase()
this.request.setRequestHea
this.request.setRequestHea
this.request.setRequestHea
}
this.request.send(this.par
}
}
function save(){
// Change GET variable here
var params = "food=";
var food = document.getElementById("f
for(o = 0; o < food.length; o ++){
if(food.item(o).selected){
params += food.item(o).value + ",";
}
}
params = params.substring(0, (params.length - 1));
// Point to your JSP file here
var XHRObj = new XHR("food.php?" + params, null, "GET");
XHRObj.make_request(
function(){
if(XHRObj.ready()){
alert(XHRObj.request.respo
}
}
);
}
//-->
</script>
</head>
<body>
<select name="food" id="food" multiple>
<option value="pizza">Pizza</optio
<option value="chips">Chips</optio
<option value="fish">Fish</option>
<option value="toast">Toast</optio
</select>
<input type="button" value=" Save " onclick="save()" />
</body>
</html>
Have included support for POST incase you can't use GET.
And for me, I use PHP, so all I need to do is split the commas up to make an array which I could then store in a database...
<?php
$food = explode(",", $_GET["food"]);
print_r($food);
?>
Only yours would be JSP.
Business Accounts
Answer for Membership
by: pD_EOPosted on 2007-02-07 at 06:05:58ID: 18484826
Example:
m/programm ing/javasc ript/ncz/ c olumn3/exa mple3b.htm
m/programm ing/javasc ript/ncz/ c olumn3/3.h tml
http://www.webreference.co
Link:
http://www.webreference.co