Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Avoid escape special characters

XandotJun 2 2017 — edited Jun 2 2017

Hello,

Facing issue while redirecting text values from one page to another like:

Page 1:

pastedImage_0.png

Page 2:

pastedImage_2.png

when I like to empno then it'll transfer ename to the next page on ename field but problem is its only showing "J & a".

after comma text is not copied to the next page, so how to handle this kind on the issue related to special char?

I'm using below code URL code for redirect page:

HTML Header:

<script language="JavaScript" type="text/javascript">

function callMyPopup (ENAME,EMPNO) {

var url;

  url = 'f?p=&APP\_ID.:11:&APP\_SESSION.::::P11\_ENAME,P11\_EMPNO:'+ escape(ENAME) +',' + EMPNO;

w = open(url,"winLov","Scrollbars=1,resizable=1,width=925,height=400");

}

</script>

pastedImage_5.png

Thanks

This post has been answered by fac586 on Jun 2 2017
Jump to Answer

Comments

fac586
Answer

Xandot wrote:

Facing issue while redirecting text values from one page to another like:

Page 1:

pastedImage_0.png

Page 2:

pastedImage_2.png

when I like to empno then it'll transfer ename to the next page on ename field but problem is its only showing "J & a".

after comma text is not copied to the next page, so how to handle this kind on the issue related to special char?

I'm using below code URL code for redirect page:

HTML Header:

  1. <scriptlanguage="JavaScript"type="text/javascript">
  2. functioncallMyPopup(ENAME,EMPNO){
  3. varurl;
  4. url='f?p=&APP_ID.:11:&APP_SESSION.::::P11_ENAME,P11_EMPNO:'+escape(ENAME)+','+EMPNO;
  5. w=open(url,"winLov","Scrollbars=1,resizable=1,width=925,height=400");
  6. }
  7. </script>

<script language="JavaScript" type="text/javascript"> function callMyPopup (ENAME,EMPNO) { var url; url = 'f?p=&APP_ID.:11:&APP_SESSION.::::P11_ENAME,P11_EMPNO:'+ escape(ENAME) +',' + EMPNO; w = open(url,"winLov","Scrollbars=1,resizable=1,width=925,height=400"); } </script>

pastedImage_5.png

It's possible to pass values containing commas in APEX URLs by escaping the value using backslashes ("\") as described in the documentation:

f?p=&APP_ID.:11:&APP_SESSION.::::P11_ENAME,P11_EMPNO:\'+escape(ENAME)+'\,'+EMPNO

However, generally the best approach is simply not to pass string values in URLs. Whilst it is possible to escape strings to make them URL- and APEX parameter-safe, it is much better practice to avoid the problem altogether. Change the application so that it only passes alphanumeric EMPNO key values as URL parameters. In target pages/regions, use the key value to retrieve ENAME using region/item source attributes, computations, or processes.

Marked as Answer by Xandot · Sep 27 2020
Xandot

Thanks for the information. I will remove text variables from the link.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 30 2017
Added on Jun 2 2017
2 comments
397 views