Copy link to clipboard
Copied
Hello,
Disclaimer: I'm learning as I go, am not super technical and I'm sure there are better ways to do what I am trying to. Open to input but remember I am not skilled with Acrobat so patience please!
I am trying to do two things with my PDF form: have fields autotab, and also be limited to only 1 number per field.
At the moment, I have the autotabbing working, however I cannot seem to set the fields to be number only. I think this is because I have the autotabbing code set the FORMAT > Custom Keynote Script area:
// Autotab to the "P1: 3. HSBC 2" field tab_next("P1: 3. HSBC 2");
If I try setting the field to be a number only, in FORMAT > Number it removes what I have set in the custom area for the autotabbing.
I also have this javascript added in the ACTIONS tab:
// Document-level function function tab_next(next_field_name) { // Move to next field if Enter key is pressed // or the user has clicked outside of the field // or if the number of character is the character limit if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) { getField(next_field_name).setFocus(); } }
If I could just get the individual fields to only show 1 number and still autotab then I would be one happy camper! Appreciate any help... thank youo in advance.
Copy link to clipboard
Copied
Use a single text field with the Comb option enabled, instead of what you currently have.
Copy link to clipboard
Copied
Thanks so much... that is exactly what I needed!
Copy link to clipboard
Copied
I have the same question, but I am not understand the question. What does that mean? Sorry, beginner here...
Copy link to clipboard
Copied
I meant I am not understanding the solution.
Copy link to clipboard
Copied
Hi Betty,
Just digging up my example file and will share with you.
Copy link to clipboard
Copied
Hi Betty,
So, you will need to add a document level javascript first. To do this:
// Document-level function function tab_next(next_field_name) { // Move to next field if Enter key is pressed // or the user has clicked outside of the field // or if the number of character is the character limit if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) { getField(next_field_name).setFocus(); } }
In my example attached, I needed to be able to click a radio button to activate the field(s) that corresponded. In mine, you can only select one of the three account types. You can double click the radio button(s) to see how I set these up to make fields visible/and invisible (click on "Actions" and click on "Run a JavaScript", and then "Edit" to see. It bascially tells the radio button(s) which fields to make visible and which fields to hide.
// Autotab to the "P1: 3. ABC account number - 2" field tab_next("P1: 3. ABC account number - 2"); if(!event.willCommit) event.rc = /^\d*$/.test(event.change);
This gets repeated for the next field, updating the field name in the code above so that it autotabs to the third field (and I don't need to do that to the third field since I don't need it to auto tab any further).
For the last field, (P1: 3. ABC account number - 3), I do need to bring up its properties, click on "Format", and in "Custom Keynote Script" enter this:
if(!event.willCommit) event.rc = /^\d*$/.test(event.change);
Providing your tab order is set up properly you should be good to go.
I hope the attached example helps?
Thanks
This is what tells
Copy link to clipboard
Copied
You can't do any of that in Acrobat Reader.
Copy link to clipboard
Copied
Yes, sorry. I meant Adobe Acrobat.