Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onchange with parameter on html:select

 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic