473,400 Members | 2,145 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,400 software developers and data experts.

Passing values in a form using javascript to a JSP page

hi all

in jsp
i created a combo box and i written a java script to select values from combo box.
when i select a value from combo box it should go to the another jsp page
for that i passed the selected value as a string along with the url in java script.
like <a href=..........?<%=val%>
then how can i get this value into another jsp page.

please any body can help me.....
its urgent for me
Mar 29 '07 #1
11 12918
r035198x
13,262 8TB
hi all

in jsp
i created a combo box and i written a java script to select values from combo box.
when i select a value from combo box it should go to the another jsp page
for that i passed the selected value as a string along with the url in java script.
like <a href=..........?<%=val%>
then how can i get this value into another jsp page.

please any body can help me.....
its urgent for me
You can set the value in a hidden input and get it in the next JSP using request.getParameter("inputName");
It's cleaner that way as you can submit the form using the post method.
Mar 29 '07 #2
You can set the value in a hidden input and get it in the next JSP using request.getParameter("inputName");
It's cleaner that way as you can submit the form using the post method.

where can i write that hidden input value
can you please provide a simple code for it
Mar 29 '07 #3
r035198x
13,262 8TB
where can i write that hidden input value
can you please provide a simple code for it
You need to put that on a form on the JSP that is submitting the page. Do you have a form on the page?
Mar 29 '07 #4
You need to put that on a form on the JSP that is submitting the page. Do you have a form on the page?

sorry i didn't get you,
i cant explain entire senariou now
imagine one.jsp is there
in that i written one combo, i took some values from data base into that combo
for selection i written java script like ...two.jsp?<%=value%>
i should pass these values to two.jsp
there i want to disply those values as hyperlinks...
how i get those values into two.jsp

please help me
Mar 29 '07 #5
r035198x
13,262 8TB
sorry i didn't get you,
i cant explain entire senariou now
imagine one.jsp is there
in that i written one combo, i took some values from data base into that combo
for selection i written java script like ...two.jsp?<%=value%>
i should pass these values to two.jsp
there i want to disply those values as hyperlinks...
how i get those values into two.jsp

please help me
Ok. How are you going from JSP one to JSP2. Are you clicking a submit button on a form or are you using an href link?
Mar 29 '07 #6
Ok. How are you going from JSP one to JSP2. Are you clicking a submit button on a form or are you using an href link?

i used only href
Mar 29 '07 #7
please provide a good solution for my problem.
thank u
Mar 29 '07 #8
r035198x
13,262 8TB
i used only href
You can use something like
[HTML]

<FORM method="post" action="<%=jsp2Path%>" name="formName" >

<a href="javascript:document.forms['formName'].submit()" ....

<INPUT type="hidden" name="value" value="<%=value %>">
</FORM>
[/HTML]
Mar 29 '07 #9
thank u very much for your reply...
but this code was not worked for me...

some how i got it...

but i got another problem

how can get a selected hyper link value into java script function
for eg:
in my jsp page
[code]
out.println("<a href='javascript:subwindow()'>"+customer+"</a>");
[code]
what i can write in subwindow() function to extract link value
please help me
Mar 30 '07 #10
r035198x
13,262 8TB
thank u very much for your reply...
but this code was not worked for me...

some how i got it...

but i got another problem

how can get a selected hyper link value into java script function
for eg:
in my jsp page
[code]
out.println("<a href='javascript:subwindow()'>"+customer+"</a>");
[code]
what i can write in subwindow() function to extract link value
please help me
Let me move this to the javascript forum then. I think it belongs there now
Mar 30 '07 #11
hi all

in jsp
i created a combo box and i written a java script to select values from combo box.
when i select a value from combo box it should go to the another jsp page
for that i passed the selected value as a string along with the url in java script.
like <a href=..........?<%=val%>
then how can i get this value into another jsp page.

please any body can help me.....
its urgent for me
go the jsp page , try to use the "value=<%=request.getParameter("value")%>"
tqag ,
u may get the o/p
bye----sunil
Dec 5 '07 #12

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

Similar topics

2
by: Frederik S | last post by:
Hello, I'm making a nice little login box in Javascript but having problems Posting the value inside a textfield. In a nutshell: I have a function: function getPostData (value)
2
by: Fabrizio | last post by:
HI, i need to pass a value from a Web Page to another in ASP.NET, eg. i want to keep the user name from a login page and diplay to next page . What should I use? Thanks, fabrizio
1
by: Bruno Alexandre | last post by:
Hi guys, How can I pass session/application values from a web page (ASP or ASP.NET) that is on a host company, into my cliente application? So I can hide menus based on access permisions once...
4
by: RipperT | last post by:
College newbie here (Instructor MIA). I have instructions to pass variable values from one web page to another like this (VS2005): 1. Declare and create the properties on the first page (source...
2
by: sabinrajk | last post by:
I am beginner, please help me for the following issue i have a value in my javascript function, i have to pass this to the pop up window generated using this fucntion itself Please help ...
6
by: bizt | last post by:
Hi, First let me point out I have googled this and also must have done this operation a dozen times (altho a few years ago) but for some reason I cant get a form to submit using javascript .....
4
by: ghjk | last post by:
I'm developing web application using php and my sql. And use Jpgraph for graph creation. Because of the probelm to edit jpgraph php file i want to pass values to it. Ex. main.php have...
4
by: phpuser123 | last post by:
I want to submit my form using javascript but the prob I am facing here is when using this method,the form is being submitted irrespective of the return value of onsubmit .My script is ..... ...
5
by: nesha | last post by:
Hi, I have a html page in which im using a form. In that form i placed a div element within the form. That div element has another div element within that. how to get the innermost div element value...
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
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...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.