JavaScript in Adobe Acrobat 8

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wiizl
    New Member
    • Feb 2008
    • 2

    JavaScript in Adobe Acrobat 8

    I really need help on this one.
    The problem is quite simple-
    I've got many text fields that user has to fill. The thing I can't figure out is how NOT to allow go to next field if the length of current field's value is less than 6 digits. I tried something like this, but I know almost nothing about javascript:

    Code:
    var lg = getField("From[0]").value.length;
    if(lg<6 && lg>0){
    getField("From[0]").setFocus();
    }
    And I've put this in onBlur event... Could anybody help me?
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    ECMAScript (sometimes called JavaScript) is unrelated the programming language Java, so I have moved your post to the correct forum.

    Comment

    • tswaters
      New Member
      • Feb 2007
      • 19

      #3
      Hmmmm.... Generally you use javascript in PDF forms to show calculations.

      validation is generally handled seperatly...... ... I use "Adobe Designer" to create forms and under "Properties ", "Object", "Value" there's a drop drown for "type" of which lists, "User Entered-Optional [default]", "User Entered-Recommended", "User Entered-Required"... setting it to the latter will blcok a form submission if the field is blank ... that's generally how you control that sort of thing in pdf forms.

      IMO: It's never nice to control your users' input onBlur/Focus -- if they try and submit a blank form, stop them -- but let 'em have a little freedom when filling it out.

      Comment

      • Wiizl
        New Member
        • Feb 2008
        • 2

        #4
        I'd love to leave them freedom, but this 6 digit limitation is what my boss wants.. I've no choice,.. and no ideas also..

        Comment

        Working...