Dave Higgins

Greenhorn
+ Follow
since Jan 12, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dave Higgins

I've created a Javascript dropdown that dynamically populates from a database. I can also select from the dropdown and have the form action send it to the database as an insert statement (i.e. editing the initial dropdown value).

My problem is I can't find a way to create the ability to select multiple values from the dropdown and have them populate the database with the form action.

Thanks for any help. -I didn't see anything on the JavaRanch forum.

Dave

Here are excerpts from the various codings to illustrate my syntax:

JSP
<td align="center">
<div align="center" id="sidSA">
<span id="xrefsid" name="xrefsid"></span>
</div><br/>
</td>

.js
var xspan2 = document.getElementById("xrefsid");
var dropdown = document.createElement("select");
dropdown.setAttribute("id","sid");
dropdown.setAttribute("name","SID");
dropdown.multiple='true';
dropdown.size = 5;
dropdown.value = "<%= userSiteID %>";

var opt2;
var txtNode2;
for(var i=0;i<responseData.length;++i)
{
opt2 = document.createElement("option");
txtNode2 = document.createTextNode(responseData[i]);
opt2.appendChild(txtNode2);
dropdown.appendChild(opt2);

}
if (xspan2.firstChild != null)
{
xspan2.removeChild(xspan2.firstChild);
}
xspan2.appendChild(dropdown);

Servlet
else if (action.equals("sidlist")) {
String sidlist = request.getParameter("xref");
Iterator<String> it3 = ObjXREF.getSIDList(sidlist).iterator();
String temp3 = "";
while (it3.hasNext()) {
temp3 = it3.next();
out.print(temp3 + "\n");
}
}
I agree with the above review of EPlanet's SCJA solution guide. Unfortunately, I didn't see it in time, so I'm stuck with something that's overkill, got terrible grammer, and is barely useable. Their "...not responsible..." disclamer on every page indicates they probably knew customers would be ticked. Stay far, far away from EPlanet!
14 years ago