Restrict users from cutting and pasting content(form data) in form fields

Avatar

Avatar

Radhika_Magaji

Avatar

Radhika_Magaji

Radhika_Magaji

04-03-2015

Hi,

I have a requirement where there are two fields: "Enter Email Address" and "Re-enter Email Address". The form should not allow the user to cut-and-paste the Email Address into the Re-enter field. It must be manually entered. Can this be done through javascript? Or by setting form properties with LiveCycle Designer? I'm using Es4 version. I am aware that i can restirct user from copying content within form. Solution to retrict pasting will be highly appreciated.

Thanks in advance,

Radhika

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

04-05-2015

Hi,

you can check if the Ctrl-Button is pressed while the new value is entered in a field.

So you can at least avoid pasing through Ctrl + V key combination.


if (xfa.event.change.length > 1 || xfa.event.modifier === true ) {


    xfa.event.change = "";


}


Answers (4)

Answers (4)

Avatar

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

05-03-2015

You can add a JavaScript script in the change event to check how long the inserted value is.

When users types in the value it will be 1 but when the value is pasted it will be longer.

if (xfa.event.change.length > 1) {

     xfa.event.change = "";

}

Avatar

Avatar

Radhika_Magaji

Avatar

Radhika_Magaji

Radhika_Magaji

05-05-2015

Hey radzmar,

I'd be grateful if you could look in the below thread and provide a solution. I see you have answered a few questions there.

Re: How to force alpha or numeric inside text fields - LiveCycle Designer 9.0

Thanks,

Radhika

Avatar

Avatar

Radhika_Magaji

Avatar

Radhika_Magaji

Radhika_Magaji

05-05-2015

This worked radzmar!

Thanks

Radhika

Avatar

Avatar

Radhika_Magaji

Avatar

Radhika_Magaji

Radhika_Magaji

29-04-2015

Hi radzmar,

This works perfectly fine as long as the field is an email address.

But in other case, if i have "Text Field1" rawvalue to have 1 character entered, it wil still copy that 1 character to other field.

Can we restrict user from copying the value itself so that he has no way to paste it at all?

Thanks,

Radhika