aspose file tools*
The moose likes JSP and the fly likes JavaScript within JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JavaScript within JSP" Watch "JavaScript within JSP" New topic
Author

JavaScript within JSP

sreekanth rach
Greenhorn

Joined: Jan 02, 2003
Posts: 14
Hi Friends!!
How can i use JavaScript Variable within JSP page..
like my requirement is, i want to use that JavaScript variable in a SQL-query (everything within JSP page)..
plz look into this..
kindly, provide me the solution at the earliest..
'am in real-need of you..
thanks in advance,to everyone..
Sree.
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319
JavaScript variables are accessible nowhere except Javascript code. But you can store a javascript variable's value in a HTML Form element (possibly hidden) and then access it in ur JSP
HTH
Sudharsan
sumana ar
Greenhorn

Joined: Aug 06, 2003
Posts: 28
hai..
suppose u are having a form field username ..then use the setProperty to set a variable username suing JSP. now u can use that JSP variable in the SQL-Query as..
"select * from emp where ename ='"+usename+"'"
now emp is the table name and ename is the attribute..hope this would help u
--sumana
 
wood burning stoves
 
subject: JavaScript within JSP