This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onchange with parameter on html:select

 
aishwarya lakshmi
Greenhorn
Posts: 20
  • 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
  • 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
  • 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 %>"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic