Hi Andrew and Shobhana,

As far as I know, you cant mix static text and dynamic text within a JSP. If
I remember correctly, something like the following code should work.

<%
  String tempString="javascript:find(" + value + "\";"; // Not sure about
the semicolon...
%>

and then:

<html:text size="20" property="userId"
onchange="<%= tempString %>"/></TD>

I'll make sure to try the single quotes (') around the dynamic text some
time, cause it's really annoying to use the method im describing here.


Regards, Andreas

-----Ursprüngliche Nachricht-----
Von: Andrew Hill [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. M?rz 2004 10:30
An: Struts Users Mailing List
Betreff: RE: help in java script


Should not that be:

<html:text size="20" property="userId"
onchange="javascript:find('<%=value%>')"/></TD>

(note the ' around value)

-----Original Message-----
From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 March 2004 17:27
To: Struts Users Mailing List
Subject: help in java script


Hi !

I'm getting a problem when i use java script in my struts application.

My code runs as follows:

<SCRIPT >
funtion change(value)
 {
 alert(value);
}
</SCRIPT>

<BODY>
...
,,,
<% String value="hello";%>
<html:text size="20" property="userId"
onchange="javascript:find(<%=value%>)"/></TD>

the problem is the onchange event is not being called.

when i don't pass a scriplet variable the event gets called..say
onchange="javascript:find('hello'); it gets callled..

could anyone suggest me how to pass a dynamic value to javascript function
in struts?

Thank you.

Shobhana



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to