Forum Discussion

PatrickDunn's avatar
PatrickDunn
Qrew Assistant Captain
5 years ago

iol and intercept .onpaste

Hello. Would I be able to use the iol technique to to intercept .onpaste and use my own custom code?


Thanks!

------------------------------
Patrick Dunn
------------------------------

7 Replies

  • Yes, are you trying to detect the paste for a certain field? 

    $("#tdf_9").on("paste", function() {
    alert("You pasted into the field!");
    });​


    ------------------------------
    Everett Patterson
    ------------------------------
    • PatrickDunn's avatar
      PatrickDunn
      Qrew Assistant Captain
      Thanks, Everett!!! Would it be possible for the code to intercept paste on any field in the form (i.e. without explicitly identifying each field)?

      ------------------------------
      Patrick Dunn
      ------------------------------
      • PatrickDunn's avatar
        PatrickDunn
        Qrew Assistant Captain
        For context, my ultimate goal is to force Chrome to paste into rich text fields the same way that Firefox pastes, i.e. base64 encoding any images in the clipboard. I have a form with a lot of rich text fields, and I would prefer to have the iol setup such that when a user pastes anywhere in the form, paste like Firefox.

        ------------------------------
        Patrick Dunn
        ------------------------------