473,388 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

passing javascript value to jsp page

Hi,

I would like to find out how to do the above.

I retrieve the value from database using a javabean and return this to
jsp page and display the data using html/javascript dropdown listbox.

I will need to use the selected value from user and pass this value to
javabean to retrieve another value to be displayed on the same
page/form (without having to submit the page)

Pls help.

Oct 4 '05 #1
1 1727
i am assuming that you already know how to get the info from the db, as
that is far beyond the scope of this group. (if not, comp.lang.java.*
would be a good place to ask about that)

what you are talking about is using the XMLHTTPRequest object (commonly
known as ajax) it sounds like, then modifying the DOM to use the
returned info. ajax itself would require a long reply just to explain,
so i will refer you to http://jibbering.com/2002/4/httprequest.html and
, easily the two best tutorials around. assuming you return a XML doc
with the info you need (simplest way), with each option wrapped in an
<option> tag, you would then do something to the effect of:

dropdown = document.getElementById('theDropDownListToModify') ;
opts = xmlhttpObj.returnedXML.getElementsByTagName('optio n');
for (i=0;i<opts.length;i++) {
dropdown.options[i] = new Option(opts[i].firstChild.data;
}

If that isn't clear (it is late) email me or whatever and i would be
glad to help more

Oct 4 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Judy M | last post by:
I am a Javascript Newbie, but have read two of the brick-sized books and read the deja section and FAQ's and didn't find my answer. I'm sure it is simple and apologize in advance, but here goes......
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
10
by: Noozer | last post by:
Below is some ASP, HTML and javascript. It is part of a page used to maintain a small database. This code did work at one time, but has since stopped. For some reason the data on my form is not...
5
by: Paul | last post by:
Just wondering if someone could provide an example of passing a variable from the code behind to javascript in vb. I want to have one control have focus with the page loading with one condition...
3
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a...
5
by: Steve | last post by:
Hi, I currently have a problem passing a variable value from one page to another. Once a form submit button is pressed java pops up a window and displays some information. The problem being is...
5
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue,...
10
by: amerar | last post by:
Hi All, I am writing some screen strictly in PHP. I have a screen with a combo box in it. I do not want to use forms, just links on the page. What I want to do, is when the user selects the...
5
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.