This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes onchange with parameter on html:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "onchange with parameter on html:select" Watch "onchange with parameter on html:select" New topic
Author

onchange with parameter on html:select

aishwarya lakshmi
Greenhorn

Joined: Nov 18, 2008
Posts: 20
Hi
I need to make a java script call by onchange methos with parameter from Struts html:select statement. when i tries that its showing Illegal xml exception.


some thing like

<html:select property="selectedItem" onchange="javascript:doOnchange(<%=i%>)">
<htmlption value="Maria">Maria</htmlption>
<htmlption value="Klaus">Klaus</htmlption>
</html:select>


How to pass scriptlet from javascript method in html:select.

Thanks
Lakshmi
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi aishwarya,

It seems right.
we can give expression in onchange attribute of html:select tag.
Problem may be different.
Please post whole stack trace of exception.


Thanks,
Shailesh
aishwarya lakshmi
Greenhorn

Joined: Nov 18, 2008
Posts: 20
thanks for your response

i archived it passing it in string

<%
String s = "javascript:doOnchange("+i+")";
%>


onchange = "<%= s %>"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onchange with parameter on html:select