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

Get selected value into variable

hi all
i got a problem with java script

i written a href tag in jsp page
i was not able to get selected value into a variable in java script function.
see my code here. here iam taking customer value from database.
Expand|Select|Wrap|Line Numbers
  1.  <BODY>
  2. <table>
  3. <td>
  4. out.println("<a href='#'  onclick='subwindow()'>" +customer+ "</a>");
  5. .
  6. .
  7. .
  8. .
  9. function subwindow() {
  10. }
  11.  
can any body help me please.
Mar 31 '07 #1
6 4332
r035198x
13,262 8TB
hi all
i got a problem with java script

i written a href tag in jsp page
i was not able to get selected value into a variable in java script function.
see my code here. here iam taking customer value from database.
Expand|Select|Wrap|Line Numbers
  1. <BODY>
  2. <table>
  3. <td>
  4. out.println("<a href='#' onclick='subwindow()'>" +customer+ "</a>");
  5. .
  6. .
  7. .
  8. .
  9. function subwindow() {
  10. }
  11.  
can any body help me please.
Can you eplain more? You were not able to get which value from where to where?
Mar 31 '07 #2
JosAH
11,448 Expert 8TB
Those JSP scriptlets need to be tagged with their own little tags too.
As it is now the Java text will be taken as literal text for a table cell.

I sincerely hate doing things this way because you have to deal with at least
three different languages/notations in one document: html, Java and JavaScript;
sometimes people even manage to add a fourth: JSTL stuff. It can not be
properly maintained this way.

kind regards,

Jos
Mar 31 '07 #3
Can you eplain more? You were not able to get which value from where to where?

Expand|Select|Wrap|Line Numbers
  1. out.println("<a href="#" onclick='subwindow()'>" +customer+ "</a>");
  2.  
i was unable to get the value of clicked link that mean i want to get the value of customer (which i selected as link in browser) into java script variable of subwindow() function..

can you tell me how can i get it
Apr 2 '07 #4
r035198x
13,262 8TB
Expand|Select|Wrap|Line Numbers
  1. out.println("<a href="#" onclick='subwindow()'>" +customer+ "</a>");
  2.  
i was unable to get the value of clicked link that mean i want to get the value of customer (which i selected as link in browser) into java script variable of subwindow() function..

can you tell me how can i get it
I'll move this to the Javascript forum
Apr 2 '07 #5
acoder
16,027 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. out.println("<a href="#" onclick='subwindow()'>" +customer+ "</a>");
  2.  
i was unable to get the value of clicked link that mean i want to get the value of customer (which i selected as link in browser) into java script variable of subwindow() function..

can you tell me how can i get it
I'm not sure what you're trying to do here. Post more code or give a link.
Apr 2 '07 #6
acoder
16,027 Expert Mod 8TB
Changed thread title.
Apr 2 '07 #7

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

Similar topics

4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
6
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject...
2
by: Tom Bray | last post by:
Ok I am baffled I can not figure out this problem. I am getting the following error: Portal Error - A DropDownList cannot have multiple items selected. Error information Name Value Message...
2
by: OceanBreeze | last post by:
I am using ASP.Net 2.0 and C# and new to this. I have programmatically added a zip code drop down into web form inside Page_Load method as: ZipDropDown.Items.Add("11111");...
1
by: Mitesh | last post by:
Hi, I have the following HTML code right now. Code: ------------------------------------------------------------------------------------------------------------------------- <td...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
7
by: pardesiya | last post by:
Friends, I need to write a javascript function (which will be called on clicking a button) to return the currently selected item from a drop- down list whose rendered html is below. <select...
2
by: comerica1 | last post by:
I have the basic structure as follows: 2 drop downs A & B. A is populated using (datasource methods - from database). B is poulated using A's selected value as input and retrieve the list...
1
by: gubbachchi | last post by:
Hi, How can I get the selected item of the drop down box into a php variable in the same page. The options in drop down box are A,B and C and the code is here <select> <option value="Item...
1
by: destiny007 | last post by:
can any one help me to write code to capture selected text from a page but problem is that i am not able to decide where to call the functio.in this case the function is called in all cases of mouse...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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...
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...

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.