I have the below javascript entered in Forms Version 12.
I'm pulling up the form in Chrome version 144.0.7559.133.
The console is displaying: ERROR SyntaxError: Unexpected identifier 'myFieldValue'.
I'm not seeing the syntax error. Can anyone see what I'm missing? Is it the myFieldValue.IsEmpty()?
Not sure if I'm allowed to use that in LaserFiche.
//Function to copy Last Name at Birth to Last Name if Last name is empty
//You just need to pass in the field ID Number of Last name at birth and
// fieldId of Last name.
function UpdateLastName(fieldIDNumber, fieldIDNumbertoCopy)
{
//Retrieve all fields with that indicated ID.
var myField = LFForm.findFieldsByFieldId(fieldIDNumber);
var myFieldValue = LFForm.getFieldValues(myField);
//Loop through all field values if 2 or more were found,
//and call the toCapitalize function.
if myFieldValue.IsEmpty() {
LFForm.setFieldValues({fieldId: fieldIDNumber}, {fieldId: fieldIDNumbertoCopy});
} // if myFieldValue.IsEmpty()
} //End of function UpdateLastName(fieldIDNumber,fieldIDNumbertoCopy)...
LFForm.onFieldBlur(UpdateLastName(7,6),{fieldId: 6});
LFForm.onFieldBlur(UpdateLastName(7,6),{fieldId: 8});
Thank You