i am using jsp format eclipse 3.2 tomcat server 5.5. I have a problem to convert var variable (javascript) to int variable(java). what is the correct way to do this?
In html body, i use this method to throw:
String qwerty = Integer.toString(f);
String asdf = Integer.toString(d);
System.out.println("CONVERTED VALUE : "+qwerty+" "+asdf);
%>
<input type="hidden" id="balance" name="balance" value="<%=qwerty%>" />
<input type="hidden" id="loop" name="loop" value="<%=asdf%>" />
<%
System.out.println("VALUES : "+balance+" "+loop);
In html head(script):
<script>
function myfunction()
{
var looping = document.getElementById("loop").value;
var balancing = document.getElementById("balance").value;
<%
String loop="<%=document.writeln(looping)%>";
String balance="<%=document.writeln(balancing)%>";
int balance = Integer.parseInt(balancing);
int loop = Integer.parseInt(looping);
%>
..........................cont
how to convert this var to string?