how to pass jsp value in using java script to another jsp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muthulk2
    New Member
    • Feb 2014
    • 13

    how to pass jsp value in using java script to another jsp

    this is the my java script function

    Code:
    function  operation(){
    	 
    	var frm = document.getElementById("frm"); 
    	frm.action="second.jsp?n1="+<%=newname%>;
    }
    
    
    
    some jsp code
    <form name="frm" method="post">
    <%=String newname=name[i]%>
    .
    .
    .
    </form>
    Last edited by Rabbit; Feb 5 '14, 04:56 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    not at all. JSP and JavaScript have different execution times.

    Comment

    • muthulk2
      New Member
      • Feb 2014
      • 13

      #3
      thank you... i try another way but there also a problem

      i want to send multiple value to another page....this is worked for one value.but i want to send more parameters...ca n you help me



      Code:
      function  operation(name,email,pass){
      	 
      
      	  var link = "second.jsp?name="+name;
      	  window.open(link);
      	
      }
      Last edited by Rabbit; Feb 5 '14, 04:56 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        var link = "second.jsp?nam e="+name+"&name 2="+name2;

        Comment

        • muthulk2
          New Member
          • Feb 2014
          • 13

          #5
          thanks it working 100%........... thanks again.

          Comment

          Working...