Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acrobat 7 & Javascript Questions...

Status
Not open for further replies.

wreded

Technical User
Dec 18, 2001
119
US
i have a form with fields "Name.Last", "Name.First" and several other fields. The form is to be printable only. On form open i reset the fields to blanks and run a short Javascript:
====================================
var a = getField("Name.Last")
{
a.setFocus();
}
=====================================
For "Name.Last" and "Name.First" i have a short Javascript that reads:
=====================================
var a = getField("Name.Last")

if (a.value == "")
{
app.beep();
app.alert({
cMsg: "You must enter Your last name"})
a.setFocus();
}
=====================================
(var b = getField("Name.First")
On Form close i run another Javascript that goes to an empty field.

My problem is that when i open the form i get stuck in an endless loop between "Name.Last" and "Name.Last". i can disable one or the other and everything works as expected. But i WANT to have both enabled.

i have a few other issues, but i want to handle them one at a time.
Thanks,
Dave
 
Thanks, but i got it figured. Instead of using the "onBlur" of the first field i use the "onFocus" of the next field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top