3 Replies Latest reply on Oct 12, 2017 2:07 AM by JR_Boulay

    Custom phone number with specific features

    kylepines1986

      Hello!

      I need to create an interactive PDF. I am a graphic designer and I do not know JavaScript.

      In my PDF document I want user to enter his russian phone number in format +7 (111) 111-11-11.  Here "+7" is russian country code and it should be exactly like this.

       

      I understand that user might try to input "+" or parentheses or he might forget to press spacebar or accidentally hit some letter.

       

      So here is what I want exactly:

       

      1. User can not type anything but digits. When he types any other symbol nothing happens. No warning or any other thing.

       

      2. When user clicks on the field and inputs any symbol then this symbol should be changed automatically to +7 and an opening parenthesis should appear.

      For example: user types 7 then this 7 gets replaced to +7 (

       

      3. When user continues and type local area code like 963  the closing parenthesis should appear right after he types digit "3". At this point he should see +7 (963)

       

      4. When user types next three digits a hyphen should appear. For example he types 123 and he should see +7 (963) 123-

       

      5. Next is pretty straight forward. User types the next two digits and the second hypen appears. User types the last two digits and can not type any more characters.

       

      So, to say it simple way I want Acrobat to auto-format user's typing into a form of a phone number.

       

      At first I thought that the arbitrary mask is the best solution. But it does not do that I described above in 2. and 3. It also shows disgusting JavaScript warning "the value entered does not match....." when user types something wrong.

       

      I am sure it can be done with a simple Java script but I do not know it at all.