File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes passing the value to the javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing the value to the javascript" Watch "passing the value to the javascript" New topic

passing the value to the javascript

kiran par par

Joined: Oct 04, 2004
Posts: 4
Hi all I was trying to do something like this,

< html:form action="/test" <
String passedValue = "Test Value";
<html:button property="page" value="click here" on click="showValue('<%=passedValue %<')"<


function launchWFClient(value){


I am getting the value displayed as <%=passedValue %<

Is there way to pass the value that is defined in the scriptlet to the javascript, that is , is there a way to display "Test Value"
or am i getting the basics wrong?

And how do I get awa with < symbol I was not able to post with that in my content
thanks for the help in advance.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
1) yes you are getting the basics wrong.

Have a look at this thread

2) whenever posting some code snippets, use UBB code.
[ October 21, 2004: Message edited by: adeel ansari ]
It is sorta covered in the JavaRanch Style Guide.
subject: passing the value to the javascript
Similar Threads
Dynamically Mapping Form Action with javascript
request.getParameter in struts2
how to call action on click of checkbox?
4 choices on a lottery page
cant/wont clear the counter out