javascript variable to java variable

Collapse
X
 
Clear All
new posts
  • nipunm1
    New Member
    • Jul 2018
    • 1

    javascript variable to java variable

    i want to convert javascript variable to java variable i have following code:
    Code:
    <script>
       function increaseValue(strid,p,pr) {
    	   var v = parseInt(strid.value);
    	   v= isNaN(v) ? 0 : v;
    	   v++;
    	   strid.value = v;
    	   var total=v*p;
    	   pr.value=total;
    	  
    	 }
       function decreaseValue(strid,p,pr) {
    	   var v = parseInt(strid.value);
    	   v = isNaN(v) ? 0 : v;
    	   v < 1 ? v = 1 : '';
    	   v--;
    	   strid.value = v;
    	   var total=v*p;
    	   pr.value=total;
    	  
    	 }
      </script>
    <%  String st="<script>document.writeln(total)</script>"; %>
    but i am getting error :
    HTTP Status 500 - Request processing failed; nested exception is java.lang.Numbe rFormatExceptio n: For input string: "<script>docume nt.writeln(tota l)</script>"
    can please someone help me to solve it?
    Last edited by zmbd; Jul 30 '18, 10:47 AM. Reason: [z{Please do not Cross-post the same question, Please use the [Code/] format, Please read FAQ}]
Working...