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

Preventing Tabbing past User Entered Required Fields

kpdamm
Registered: Oct 9 2009
Posts: 11
Answered

Hello,

I am looking for a scripting solution that will allow me to prevent a user from tabbing past a 'User Entered - Required' field in a form. I am using LiveCycle Designer and rendering the form through Reader in WorkSpace. By default, a user cannot 'submit' a form in WorkSpace if a 'User Entered - Required' field has not been completed.
Can this be accomplished?
Konstantin

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, this can be done, but it is not a pretty solution. Each field has an "exit" event that's triggered when the focus leaves the field. Each field also has a Validate event that's triggered when data is commited to the field. You may have to use a combination of the two events. Test for a null value in the validate and then use the "xfa.host.setFocus()" fucntion to force the focus back on the field. I don't know how well this will work, it's tricky. I've built similar solutions and I seem to remember that there was a problem with the order of events and the focus. For example the validate event occurs before the field focus is moved, so calling "setFocus()" here does nothing. You have to use the validate event to setup a state variable and then use that state varible in another event ("exit" I think) to run the "setFocus()" function. To get it just right you'll need to do some testing.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

kpdamm
Registered: Oct 9 2009
Posts: 11
Thanks Thom. I was hoping the answer would be a little simpler for this:) We're upgrading from JetForms to LiveCycle, and this feature was easily supported within JetForms.