473,465 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

accesing JavaScript variable in JSP.

ak
Hi,

I want to access JavaScript in JSP.

My problem is - I am getting a value from a combo box and using
this value to set value of a variable in JS function. I want to use
this variable in JSP so that i can do further processing based on the
value I get from this variable.

Hope I am clear, please help if u know the solution.

Thanks,

AK
Jul 23 '05 #1
3 13946
On 27 Dec 2004 22:44:12 -0800, ak wrote:
I am getting a value from a combo box and using
this value to set value of a variable in JS function. I want to use
this variable in JSP so that i can do further processing ..


Post it to the page that does the processing.
(And note that this has as much to do with JSP as PHP or ASP,
since JSP's end up as HTML).

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #2
Lee
ak said:

Hi,

I want to access JavaScript in JSP.

My problem is - I am getting a value from a combo box and using
this value to set value of a variable in JS function. I want to use
this variable in JSP so that i can do further processing based on the
value I get from this variable.


Do you mean that you want the value after the form has been submitted, or
before?

Jul 23 '05 #3
what he means is that the JSP is already compiled and sent by the time
it reaches the client and the javascript is run.
So, you have to send it back to your server running the JSP so it can
process it.
There are two ways of sending back data post and get, in a nutshell
what that really means is either it's tacked onto the end of a URL like
http://www.thephred.com?matt=wonderful

or it's hidden from the end user. (The example is a get)
how do you code for it?

well if you have no form just change your document location like:

document.location.href = "http://www.thephred.com?" + key + "=" +
value;

if you have a form and the action is post put in a hidden input field

<input type="hidden" name="matt" value="wonderful" />

you can then change that value with javascript and submit the form.
hope that makes sense...
;-)

Jul 23 '05 #4

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

Similar topics

3
by: Jeroen Ceuppens | last post by:
Hi, I have a problem accesing h, when i want to do h.Run() after the if else structure, i get the following error: (see below for code) C:\Documents and Settings\Eindwerk\Mijn...
13
by: Fernando Deutsch | last post by:
I have an html page with an iframe on it. Inside the iframe there is an img element. I am looking how to reference the iframe from the img element contained on it and cannot find a way to do it. I...
3
by: mfc1981 | last post by:
Hi. I need to access to the hover style of an element with javascript. How can i do this? Best regards Manuel
1
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
3
by: makthar | last post by:
Hi How do i access an external javascript function from a .htc file. Thanks Mansoor
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
6
by: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= | last post by:
Hi everyone. I'm dealing with some javascript code which uses eval to access properties of an object. For instance, I have the following: var events = {}; events.flatUsers = {};...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.