473,387 Members | 1,757 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,387 software developers and data experts.

Need to access the selection made by the user from selection control

I have two selection controls and based on the selection made by the user i need to pass those values to the other program in java......

can u give me the way......
Aug 8 '07 #1
2 1201
r035198x
13,262 8TB
I have two selection controls and based on the selection made by the user i need to pass those values to the other program in java......

can u give me the way......
You need to explain more clearly what you have.
Do you have two Java programs running on the same JVM?
Aug 8 '07 #2
itsraghz
127 100+
Hi subbaraju,

welcome to TSDN. You can very well do it by getting the value from the controlbox and putting it inside.

The select box (in HTML control) has some properties

(*) selectedIndex -> the index of the item/option presently selected
(*) value -> the value of the item being selected.

Let's say you have a select box which gets rendered like this..

Expand|Select|Wrap|Line Numbers
  1. <select id="mySelectBox">
  2. <option value="v1">ABC</option>
  3. <option value="v2">DEF</option>
  4. </select>
  5.  
You can make a JavaScript function get executed on changing the value of the select box by calling it in the 'onChange' property. Inside the javascript function, you can get it by accessing

Expand|Select|Wrap|Line Numbers
  1. var index = document.forms[0].mySelectBox.selectedIndex;
  2. var selValue = document.forms[0].mySelectBox.value;
  3.  
Here the index would be '1' and value would be 'v1' if you have chosen the 'ABC' in the list box.

Get the value in a hidden variable and submit it to a page where you can retrieve the value from the 'request' scope.

Hope this helps!
Aug 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
4
by: theo | last post by:
Program flow...load file,then extract the xml text tags from the file,then the number of Xml tags retrieved from the file determines the number of dropdownlist controls instanciated in the...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
3
by: Dodger | last post by:
I've been working on this little doohickey for a bit now... (please ignore the speed issues of some of the queries -- things aren't all optimised up in mysql yet) ...
13
by: canam | last post by:
Hi Everyone. I hope someone can point me in the right direction. I have an input form where I have set one Combo Box to fill in a Text Box when a selection is made from the drop down. I would...
1
by: mvlt | last post by:
I recently made the switch from Access 2003 to Access 2007. The rest of our office is still operating on 2003, so the database is still a 2003 file. We're having trouble with a few forms that work...
0
by: joeller | last post by:
I need to dynamically load controls and access the methods and property of the control from the page. I need to load a different control depending on a selection made by the user. I have buttons on...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.