Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening an popup.

 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using struts. I have a req. in which i click on submit button i need to open an pop up show some values and close of that popup do some validations. I am using an modal dialog for doing that. I am doing this way

var check=window.showModalDialog("LoadPreSum.do?strSeqID="
+strSeqID+"&strNum="+strNum
+"&strButton="+strButton,window.self,
"dialogHeight:280px;dialogWidth:950px;status:no;scroll:no;help:no");

Here the problem is strNum can be any character. If strNum contains %,& etc, i am getting error and i am not able to get the exact values in action class. Can any one suggest a way to avoid this.

Thanks and Regards,
Arul.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this value might have characters that will mess up a URL, you will have to write a javaScript function that will encode offending characters. Then send strNum to that function before putting it into the URL.

Here's a sample javaScript encoder fucction that I got off the web:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic