when you encode it you must decode it also, to get the value. try using the decode function.
-----Original Message----- From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Jan Arenö Sent: Tuesday, February 04, 2003 1:53 PM To: [EMAIL PROTECTED] Subject: JSP to JavaScript error Hi, this is a JSP/Javascript question I send a Oracle db Rowid between two pages. Since the Rowid can contain '+' char i use URLEncoder.encode. I have a link <a href="javascript: nextPage('<%=URLEncoder.encode(Rowid)%>')">Next page</a> <script> function nextPage(rowid) { //Do some stuff... and end in: eval("document.location='step3.jsp?searchrow="+rowid+"'"); } </script> The URLEncoder fix the '+' char to %2 (i think it is), and that works fine. But sins the javascript call will be <a href="javascript: nextPage('12345%267890')">Next page</a> the browser sends '12345+67890' to the function, and there the '+' sign will be converted to an ' ' (space) in the url. How do I fix this? Is there a smart way? OBSERVE!!! I have a IE specific solution also, where I put the javascript part in a OnClick <TD onClick="nextPage('<%=URLEncoder.encode(Rowid)%>')">Click this td to go to next page</TD> But this does not Work on NS etc!!! Also observe that NS can handle the + sign parameter to the javascript Regards Jan =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com