LiveCycle 11 Locking Date Time Box from changing

Chuck_Wittmaack

25-04-2019

Greetings

This is a Check list form that consists of Check Box's, Text Box's and Date and Time Box's

Once the person completes the check they enter there Initials in the TextBox (TXTB1) and on Exit it Automatically checks the TextBox for Data then it Checks the CheckBox (CB1), and enters the Date and time in the DateTime Box (TIMB1) it also makes the CheckBox, TextBox, and DateTime box Read only. I am using JavaScript and FormCalc. I also have it Setting focus to the next CheckBox in the list once you leave the Initials box.

My problem is that if you Tab through the fields again the Time will change. I need to stop the time from changing. Here is the Code I am using.

On Exit. Using Language FormCalc

TIMB1.rawValue = Concat(Num2Date(date(), "M/D/YYYY "), "@ ", Num2Time(time(), "HH:MM:SS"));

TXTB1.access= "readOnly";

TIMB1.access = "readOnly"; 

CB1.access = "readOnly";

xfa.host.setFocus("CB2");

On Change.  Using Language JavaScript

var txtLength = xfa.event.newText.length;

  if(txtLength > 0 ) {

CB1.rawValue = "1";

}

  else {

CB1.rawValue = "0";

}

xfa.event.change = xfa.event.change.toUpperCase();

All code is being used in TXTB1

Thank you for any help you can give me.

Chuck.

View Entire Topic

MinusZero

28-04-2019

Hi Chuck,

If you tab through the fields and it changes the date/time. Set the object's access to 'protected'. Protected objects are excluded from tabbing. That might stop it changing since you can't get into it.