PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________

Good (or not so good) things always happen on Fridays...

Timing issues are always a bit a problem, and can be tricky to work with.

One thing you could do:

Set a document level variable (a variable you have defined in a document level script) to a specific value, and evaluate this variable to control the setFocus() in the Blur event, particularly in the Blur event of the numeric field.

• So, you would define at document level:

var jumper = true ;

• In the script where you control the readonly property of the subgroups, you set the jumper variable:

jumper = this.getField("subgroup field").readonly ;

• In the Blur event of the numeric field, you evaluate:

    if (!jumper) {
    this.getField("subgroup field 1").setFocus() ;
    } else {
    this.getField("the normal next field").setFocus() ;
    }

And that should do it.

Hope, this can help.


Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland

Fax:  +41 1 700 20 37
  or  +1 815 425 6566
e-mail:  mailto:[EMAIL PROTECTED]
http://www.prodok.com



[ Building Bridges for Information ]


______________________




Shameless Plug:

My next conference appearances and workshops:
• Training classes in cooperation with essociates Group, in Toronto, ON, Canada, March 9 - 12, 2004; more information at http://www.essociatesgroup.com/acrobatformswithmaxwyss.htm and http://www.essociatesgroup.com/MultipleLanguageFormsInAcrobat.htm
• And, as always, available for on-site workshops/tutorials/consulting.



_________________________







I've got an interesting timing problem with a form that uses setFocus().
 
Picture this first page of a form:
The second last question is a yes/no checkbox.  "Yes" response unlocks (readonly=false) two other sub-groups of check boxes.
The last question is a simple numeric field.
The last item in that page's tab order is a WWW link (not by choice).
 
I've added logic to lock up the sub-category questions into the yes/no check boxes.  If the response is "Yes", the fields are unlocked and the first field is tabbed into using setFocus().  So far so good.
 
I've also added a setFocus() to the onBlur action in the last (numeric) field on the page to tab "past" the WWW Link (at the top of the page) right to the first question on page 2.
 
Here's where the problems begin - When the user hits "TAB" after the main yes/no check box, the cursor first goes to the next "unlocked" (readonly = false) field which in this case is the numeric field.  Usually the script then fires and puts the cursor into whatever field the setFocus() command states.  The problem with this scenario, however, is that the numeric field also has a setFocus() command in it - in the "onBlur" action.  So before my first script (in the check boxes) can fire and set the cursor into the field I want, the onBlur script in the numeric field fires, sending the cursor to the second page.
 
Is there anything I can do about this?  I know why it's happening (the cursor travels before the JavaScript is run and the onBlur action of the field the cursor is in overrides the onBlur action of the original checkbox).  I really hope this makes sense...
 
Yeah, Max, I know - Friday again...




To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html



Reply via email to