JavaScript – Text Forms

Tagged: ,

  • JavaScript – Text Forms

    Posted by Talina Barajas-Chen on December 22, 2023 at 11:43 am

    Trying to get started in JavaScript with Revu and manipulate a few PDF forms I’ve created for work. Is there a way to utilize script to automatically push from one line to another. So like in the photo I attached, it would be great to be writing and when Line 1 fills up, the text automatically moves to Line 2.

    Does anyone have any guides I can follow to help with this?

    Isaac Harned replied 4 months ago 3 Members · 3 Replies
  • 3 Replies
  • Troy DeGroot

    Organizer
    December 23, 2023 at 1:08 pm
    Points: 20,929
    Rank: UC2 Brainery Brown Belt UC2 Brainery Advanced Brown Belt Rank

    You can eliminate the need for the script if you create one field with wrapping text. This way you can also force when you want the text to wrap rather than just the box limitations.

    Or do you specifically want the next line in a different field?

  • Isaac Harned

    Member
    December 29, 2023 at 10:14 am
    Points: 6,258
    Rank: UC2 Brainery Purple Belt I UC2 Brainery Purple Belt I

    Sorry for the delay, just getting back from that sweet sweet PTO.

    I think you are trying to move from one form field to another, which there is not easy way to do that I know of as the triggers provided for the script to activate can’t detect a specific key pressed. Best I can tell you is to set the Tab Order so you can tab to this next.

    But yes also as Troy says, if it can be solved in a single form field then that would probably be the preferred route.

  • Isaac Harned

    Member
    December 29, 2023 at 10:24 am
    Points: 6,258
    Rank: UC2 Brainery Purple Belt I UC2 Brainery Purple Belt I

    If you want to play with the triggers to see if there are any convenient use cases for you the code itself would be pretty simple: “getField(“FIELDNAME”).setFocus();”

    You could try to set this “on blur” so that when user click away from cell, it moves them to the desired. May be the closest you can get.

Log in to reply.