• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

onchange with parameter on html:select

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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%>)">
<html:option value="Maria">Maria</html:option>
<html:option value="Klaus">Klaus</html:option>
</html:select>


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

Thanks
Lakshmi
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your response

i archived it passing it in string

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


onchange = "<%= s %>"
 
Can't .... do .... plaid .... So I did this tiny ad instead:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic