I have a .jsp page in which I used on click JavaScript function for further validation and other processing stuff. Now I've created an array in jsp scriptlets and how do I pass into this JavaScript function that gets called when submit button is hit? I tried something like this:
var jsArray = <%=lineArray%>;
But that didn't work out.
In fact the function wasn't getting called after I the put above scriptlet. So how do I copy this java array into a JavaScript array?
Try something like this:
This will generate javascript array variable
jsArray
and put the JavalineArray
values into it. If that's what you need to do.