18
rated 0 times
[
19]
[
1]
/ answers: 1 / hits: 21799
/ 12 Years ago, thu, june 28, 2012, 12:00:00
There is a JSP page in which i have an ArrayList variable. I need these arraylist values(txt1 and txt2) in script tag.I have tried lots of combinations and googling but didnot succeed.
javascript function
function fun1()
{
// how to get arraylist values
}
JSP page:
<body>
<%
ArrayList<String> al= new ArrayList<String>();
al.add(txt1);
al.add(txt2);
out.println(<input type=text id= + al.get(0) + >);out.println(<br>);
out.println(<input type=text id= + al.get(1) + >);out.println(<br>);
out.println(<input type=button id=btn1 value=click onClick=fun1(); > );
%>
</body>
Thanks for reply
More From » java