I use the onclick event for an input tag in my form. I pass it an integer. I need to set a jsp session variable with the value of this variable. How can I get the javascript integer variable into the jsp code to set the session variable? One doesn't seem to recognoze the other. I have:
<script>
function copy(row)
{
selected_row=row;
<%
session.putValue("sel_row", new Integer(selected_row));
if (session.getValue("sel_row"
!= null) {
jsp_sel_row = ((Integer) session.getValue("sel_row"
).intValue();
}
%>
</script>
.
.
.
<INPUT name=cmd_copy type=image src="copy.gif" alt="Copy Row" onclick="copy(<%=i%>)">
This doesn't work - jsp_sel_row is still 0. Any ideas? Thanks again.
<script>
function copy(row)
{
selected_row=row;
<%
session.putValue("sel_row", new Integer(selected_row));
if (session.getValue("sel_row"
jsp_sel_row = ((Integer) session.getValue("sel_row"
}
%>
</script>
.
.
.
<INPUT name=cmd_copy type=image src="copy.gif" alt="Copy Row" onclick="copy(<%=i%>)">
This doesn't work - jsp_sel_row is still 0. Any ideas? Thanks again.