These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Javascript question

dennismonsewicz
Registered: Feb 11 2010
Posts: 8

Excuse my newb questions... but I am having a hard time understanding where to actually place my piece of javascript to run.

I am wanting to check if the field is full then tab to the next field but its not working...

I have right clicked on the field > clicked properties > clicked actions tab > set my trigger to on focus > clicked add > and typed up my javascript, but its not working!

Any ideas?

here is my code:

if(event.fieldFull) {
app.alert("HEY!");
}

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
From the Acrobat JavaScript API for the 'fieldFull' property:

"Set to true when the user attempts to enter text that does not fit in the field due to either a space limitation (the Field object property doNotScroll is set to true) or the maximum character limit (the Field object property charLimit is set to a positive value). When fieldFull is true, event.changeEx is set to the entire text string the user attempted to enter and event.change is the text string cropped to what fits within the field.

"Only available in keystroke events for text fields."

So you need to place the script in the 'Custom keystroke script field' on the 'Format' tab and select the 'Custom' option to get to the custom keystroke script and format script options.

George Kaiser

dennismonsewicz
Registered: Feb 11 2010
Posts: 8
I have done all of that and the only way this script will do anything is if you tab out of the field, which defeats the whole purpose of an autotab funtion.
GUILLERMOPIMENTEL
Registered: Jan 20 2010
Posts: 8
There's any way that in a Acrobat PDF Form you can populate records from a Excel File, mean date merge into text fields in a PDF form?

Guillermo
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
dennismonsewicz wrote:
I have done all of that and the only way this script will do anything is if you tab out of the field, which defeats the whole purpose of an autotab funtion.
I posted a sample [url=http://forums.adobe.com/thread/575814?tstart=0]SetFocus Problem[/url] that has a working script.

The script will jump to the next field after the field is filled to the stated length or if the field can not hold any more text.

George Kaiser

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
GUILLERMOPIMENTEL wrote:
There's any way that in a Acrobat PDF Form you can populate records from a Excel File, mean date merge into text fields in a PDF form?Guillermo
You should start a new post so all of the responses pertain to your question.

George Kaiser

GUILLERMOPIMENTEL
Registered: Jan 20 2010
Posts: 8
I tried your pdf but I am getting a wrong message "Some data in the text file was not imported successfully."
the fiel from Excel is .txt Tab Delimited.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
GUILLERMOPIMENTEL wrote:
I tried your pdf but I am getting a wrong message "Some data in the text file was not imported successfully."
the fiel from Excel is .txt Tab Delimited.
The PDF is about setting the focous to a different field and not importing data from Excel.

Please start a new post.

George Kaiser