key stroke detection in TextField? - InfoPath Dev
in

InfoPath Dev

key stroke detection in TextField?

Last post 04-07-2013 09:19 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-06-2013 03:13 PM

    key stroke detection in TextField?

    Hi there,

    Is it possible programatically to detect key strokes in a text field?  I want to add a "Comments" box to a form and have a counter underneath it that indicates how many characters left in the "max limit" of the field?  e.g....

    Comments:

    [............. text box ..............]

                             (0 of 255)  <--- becomes (1 of 255) after a letter is entered.

    In theory on each key stroke I would check length of the comments field, ask for max length attribute then format a message and put it inot another field.  Not sure if Infopath provides a mechanism for doing this?

    Thx,

    Rob

  • 04-07-2013 09:19 PM In reply to

    Re: key stroke detection in TextField?

    Hi Rob,

    No, InfoPath doesn't support this.  For small field validation (16 characters or less), you could break them up into 1 character fields with each one next to another so it looks like a composite field. Then, you can right click each field and on the Display tab check the "Limit text box to: 1 character" box and also check the "Move to next control automatically when limit reach" checkbox. Then, you can add a calculated value that auto-calculates the remaining characters. In theory, you could do this with a 255 character field, but it would involve adding 255 1-character attributes underneath the field and so it would be way overkill, but you could do it.

    Good luck,

    P

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.