Mea culpa, mea culpa, mea maxima culpa (I'm sorry, I'm sorry, I'm very sorry).
Natalie, since posting the thread, there have been some comments as to why put the script on the Exit Event of the Checkbox. Stefan has suggested a better solution: By hiding the checkbox and incorporating a button instead, which the User click and pushes a command to the checkbox. The script from Stefan is as follows (Note Button name = "Protect" and hidden (invisible) Checkbox name = "Lock"):
b CLICK EVENT of Button "Protect":
if (Mytext1.rawValue != null && Mytext1.rawValue.length > 0 && MyDate.rawValue != null && MyDate.rawValue.length > 0)
{
// "lock" the fields
Mytext1.access = "readOnly";
MyDate.access = "readOnly";
// save value of lock
Lock.rawValue = "1";
// make the lock button disappear after some time
app.setTimeOut("this.getField('form1[0].#subform[0].Protect[0]').hidden = true;", 1000);
}
else
{
app.alert("Please enter data in both fields prior to locking them.");
}
(I particularly like the inclusion of the app.Alert)
b READY:LAYOUT EVENT of Button "Protect":
if (Lock.rawValue == "0")
{
Mytext1.access = "open";
MyDate.access = "open";
}
else
{
Protect.presence = "invisible";
}
Keep the faith: Stefan solutions are better, in that they allow for the User to select a button, which is cleaner. In addition the App.Alert ensures that the fields are completed before they are locked (in a relatively insecure way).
In coming up with this work around I have used the following Adobe forum threads and Stefan's & StevenX's help:
http://www.adobeforums.com/cgi-bin/webx/.3bbfacee/0 Goodnight, Niall