wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing the value to the javascript" Watch "passing the value to the javascript" New topic
Author

passing the value to the javascript

kiran par par
Greenhorn

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 %<')"<

</html:form<

<SCRIPT LANGUAGE="JavaScript"<
function launchWFClient(value){

alert(value);
}
</SCRIPT<

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 ]
 
Don't get me started about those stupid light bulbs.
 
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