cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the Copy and Paste for Inputfield in BSP Application

Former Member
0 Kudos

Hi,

I have a requirement for disabling the copy paste option for INPUTFIELD in BSP application using HTMLB.

I got the required javascript code but i dont have onBlur,onChange, keyDown,keyPress etc events in htmlb.

can any one suggest me how can i use the inputfield events in htmlb.

Thanks & Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi siva ,

ENTER THE CODE INTO THE BODY OF YOUR PAGE/SITE

<body onpaste="return false";>

<body oncopy="return false";>

hope this helps

Thanks ,

Ravi

Former Member
0 Kudos

Hi Ravi,

your code is for Java Script. In BSP we don't have as many events as Html.

we have only few Events.

can you test this application and let me know if you are able to solve the problem.

Thanks & Regards

Former Member
0 Kudos

Hi Siva ,

If this is not the case ur looking for then try the below code ,

<%

data : tmp_string type string.

concatenate `<input onCopy="return false;"` `onPaste="return false;"` into tmp_string.

%>

<bsp:findAndReplace find = "<input"

replace = "<%= tmp_string %>" >

<htmlb:inputField id = "Inf1"

value = "test"/>

</bsp:findAndReplace>

Former Member
0 Kudos

Thanks ravi.

it is working.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Siva,

If you cant to do this for a specific InputField, then you will have to use the findAndReplace Extension....

For Eg.

<%
data : tmp_string type string.
concatenate `<input onCopy="return false;"` `onPaste="return false;"`
%>
<bsp:findAndReplace find = `<input`
                    replace = "<% tmp_string %>" >
<htmlb:inputField id = "Inf1"
                text = "Some text here"/>
</bsp:findAndReplace>

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

Hi Shah,

you are right. my requrement is like this. I used your code but it is giving an syntax error <b>you must End abap scripting with (.).</b>

Can you please suggest me.

Thanks & Regards

Former Member
0 Kudos

So put a <b>(.)</b> after the concatenate statement.

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Message was edited by:

Tatvagna Shah

Former Member
0 Kudos

I Solved syntax Error. I checked in front ,this code is not effected .

what can i do.

Thanks