Results 1 to 5 of 5
Like Tree2Likes
  • 2 Post By JosAH

Thread: Using change event to modify pasted keystrokes

  1. #1
    Erin is offline Member
    Join Date
    Mar 2016
    Location
    Seattle
    Posts
    2
    Rep Power
    0

    Default Using change event to modify pasted keystrokes

    Hello,

    I'm editing some text fields that are routinely filled with various text by several end users. To help keep everyone succinct, the fields are set to a defined size with no expanding. I wanted to give the users a little flexibility so I found the following validation script:

    Java Code:
    if (event.value.length>=191) event.target.textSize = 0;
    else if (event.value.length<=190) event.target.textSize = 14;
    This didn't work for pasting text, since the validation doesn't occur until after the text is added to the field. So, I searched again and found xfa.event changes for keystrokes like:

    Java Code:
    xfa.event.change = xfa.event.change.toUpperCase();
    And made a bit of mess by attempting to combine them:

    Java Code:
    if (xfa.event.change.fullText.length>=191) 
    xfa.event.change.textSize = 0;
    if (xfa.event.change.fullText.length<=190) 
    xfa.event.change.textSize = 14;
    I've been looking for more information about xfa.events and text and coming up short. I greatly appreciate any guidance to links, ideas or suggestions.

    Many thanks,
    Erin

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,007
    Rep Power
    34

    Default Re: Using change event to modify pasted keystrokes

    Could you post enough code to show the import statements used and the definitions for all the variables used in the posted code?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Erin is offline Member
    Join Date
    Mar 2016
    Location
    Seattle
    Posts
    2
    Rep Power
    0

    Default Re: Using change event to modify pasted keystrokes

    Hi Rick,

    Thank you for your response. I will post your request next week since I'm in overtime and they're sending me home!

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    29

    Default Re: Using change event to modify pasted keystrokes

    Quote Originally Posted by Erin View Post
    Hi Rick,
    Hey Norm, I didn't know your other name was Rick.

    kind regards,

    Loretta
    jim829 and DarrylBurke like this.
    Build a wall around Donald Trump; I'll pay for it.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    27

    Default Re: Using change event to modify pasted keystrokes

    Looks like JavaScript to me...

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 9
    Last Post: 01-20-2011, 05:01 PM
  2. JRadioButton help (see pasted code)
    By ocarabal in forum New To Java
    Replies: 4
    Last Post: 06-02-2010, 02:56 AM
  3. Help with event to change output value in a division
    By benjibabs in forum New To Java
    Replies: 4
    Last Post: 05-07-2010, 12:29 PM
  4. Replies: 7
    Last Post: 11-23-2009, 09:42 AM
  5. Datepicker Calender - month change event - jquery
    By rmpatel101 in forum Advanced Java
    Replies: 0
    Last Post: 04-02-2008, 07:42 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •